A magnetic phase transition of YCo4B compound was observed at 150 K by measuring the temperature dependence of ac initial susceptibility from 77 to 1000 K. The magnetic anisotropy of YCo4B compound was studied on magnetically aligned powder in fields of strength up to 1 T at 77 and 300 K. By extrapolating the easy and hard magnetization curves, the anisotropy field (mu(0)H(a)) at 300 K was found to be about 2 T, while at 77 K, the easy and hard magnetization curves crossed at low field which may be associated with the magnetic phase transition occurring at 150 K. It seems that the easy magnetization direction of YCo4B deviates from the c axis when T < 150 K.