Compact encapsulating machine for coffee beans comprising: - a capsule selector, designed to contain and convey the capsules in a seat of a rotating station; - a grinding-metering and injection system of an inert gas, designed to grind the coffee beans and direct the coffee powder into said capsules previously filled with an inert gas; - a capsule closure system designed for positioning the film of said capsules previously filled with coffee powder and inhaling an inert gas before sealing; - an ultrasonic sealing system designed to ensure the tightness and repeatability of the closing process of said capsules; and - a capsule expulsion system, designed to contain and convey the escape of said capsules; characterized in that said capsule selector, connected to a rotating station, consists of a container of biodegradable capsules and an actuator, connected to a pusher, designed to administer a linear movement back and forth to said pusher adapted to convey said capsule from said container into a seat of said rotating station, said pusher shaped as a "U" necessary to facilitate the placement of said capsules in a seat of said rotating station and the subsequent positioning of said capsules from said capsule container in said pusher, said grinder-metering and injection system of an inert gas consisting of a grinder suitable for containing and grinding the coffee beans, said grinder equipped with a grinding regulator necessary to vary the granulometry and/or size of the coffee powder, act activated by an actuator connected therein, and by a dispenser able to introduce a specific dose of coffee powder into said capsule, said actuator connected to the upper part of a bracket, said metering device connected to the lower part of said bracket, said grinding-metering and injection system of an inert gas being provided with an inert gas container able to introduce in said capsule a quantity of inert gas necessary to avoid oxidation of the coffee powder, by means of a gas nozzle connected to said dispenser, and of an agitator adapted to prevent the formation of asymmetrical volumes of powder in said capsule during the filling of coffee powder, said container of inert gas operatively connected to said compact encapsulating machine for coffee beans by means of a tube, said stirrer connected to the lower part of said capsule, said grinding-metering system and injection of an inert gas is provided with a solenoid valve connected to said nozzle for gas and to said container of inert gas, said solenoid valve adapted to activate the introduction of gas into said capsule necessary to prevent formation of oxides inside said capsule, said solenoid valve managed by an HMI man-machine interface, said capsule closing system consisting of a sealing film collector connected to the upper part of a bracket by means of a nut screw connected therein, said sealing film collector necessary to seal said capsules filled with coffee powder through a linear actuator adapted to direct the bearings in a linear movement along said nut screw, said linear actuator connected to the base of said bracket, said capsule closing system being provided with a suction cup, connected to said nut screw and operated by said linear actuator, said suction cup necessary to withdraw the sealing films from said sealing film collector with the aid of a vacuum suction system, connected to the rear part of said bracket, and place them on said capsules filled with coffee powder, after injecting a second dose of inert gas by means of a nozzle operated by said solenoid valve necessary to prevent formation of oxides inside said capsule, said nozzle connected to the lower part of said bracket and said solenoid valve managed by an HMI man-machine interface, said ultrasonic sealing system consisting of a linear actuator, connected to a bracket and to an ultrasonic transducer operatively connected to a support, said ultrasonic transducer adapted to seal said capsules filled with coffee powder by transmitting the vibratory energy to a welding base or horn, connected to said ultrasonic transducer, said welding base or horn necessary to increase the amplitude of the mechanical vibrations and to transmit the vibrational energy to said capsules, said ultrasonic sealing system being provided with said welding base or horn made to connect to said sealing films and said capsules and designed according to Webster's equation and on frequency analysis, said capsule ejection system consists of a lifting device necessary to imprint and an upward force to lift said capsule from a seat, from an ejection device designed to impart a displacement force to said capsule and convey it towards a container device adapted to collect said capsules, said lifting device, ejection device and container device operatively connected to a rotating station. - a capsule selector, designed to contain and convey the capsules in a seat of a rotating station; - a grinding-metering and injection system of an inert gas, designed to grind the coffee beans and direct the coffee powder into said capsules previously filled with an inert gas; - a capsule closure system designed for positioning the film of said capsules previously filled with coffee powder and inhaling an inert gas before sealing; - an ultrasonic sealing system designed to ensure the tightness and repeatability of the closing process of said capsules; and - a capsule expulsion system, designed to contain and convey the escape of said capsules;