Brown dwarf formation and star formation efficiency are studied using a nested grid simulation that covers five orders of magnitude in spatial scale (10^4 - 0.1AU). Starting with a rotating magnetized compact cloud with a mass of 0.22 M_sun, we follow the cloud evolution until the end of main accretion phase. Outflow of about 5 km/s emerges about 100 yr before the protostar formation and does not disappear until the end of the calculation. The mass accretion rate declines from 10^-6 M_sun/yr to 10^-8 - 10^-12 M_sun/yr in a short time (about 10^4 yr) after the protostar formation. This is because (1) a large fraction of mass is ejected from the host cloud by the protostellar outflow and (2) the gas escapes from the host cloud by the thermal pressure. At the end of the calculation, 74% (167 M_Jup) of the total mass (225 M_Jup) is outflowing from the protostar, in which 34% (77 M_Jup) of the total mass is ejected by the protostellar outflow with supersonic velocity and 40% (90 M_Jup) escapes with subsonic velocity. On the other hand, 20% (45 M_Jup) is converted into the protostar and 6% (13 M_Jup) remains as the circumstellar disk. Thus, the star formation efficiency is epsilon = 0.2. The resultant protostellar mass is in the mass range of brown dwarfs. Our results indicate that brown dwarfs can be formed in compact cores in the same manner as hydrogen-burning stars, and the magnetic field and protostellar outflow are essential in determining the star formation efficiency and stellar mass.