The tool overhang length affects tool deflection and chatter that should be reduced for machined surface quality, productivity and long tool life. The shortest tool setting algorithm that uses a safe space is proposed and applied with simulation software in NC machining. The safe space in the coordinate fixed in the tool is computed by the virtual machining system that simulates NC machining by stock model, tool model and NC code. The optimal tool assembly that has largest diameter and shortest length is possible using the safe space. This algorithm has been applied over fifty companies for safe and rigid tool setting. The collision accident between holder and stock was reduced from 3 to 0 a year and the productivity was incensed about 15% by using faster feed rate acceptable for shorten tool length.