We study the structure of the group of unitriangular automorphisms of a free associative algebra and a polynomial algebra and prove that this group is a semidirect product of abelian groups. Using this decomposition we describe the structure of the lower central series and the derived series for the group of unitriangular automorphisms and prove that every element of the derived subgroup is a commutator. In addition we prove that the group of unitriangular automorphisms of a free associative algebra of rank greater than 2 is not linear and describe some two-generated subgroups of this group. Also we give a more simple system of generators for the group of tame automorphisms in comparison to that system in Umirbaev始s paper.