<p>I have a 3D printer, which wasn't used for a longer time. There is a nozzle, but don't know what diameter is it. I used several widths - from 0.2 to 0.8, switched them depending on my needs, but don't remember which one was used lately.
The nozzle is a little bit worn down, so the diameter on the side is not visible.</p>
<p>How to get the nozzle diameter, without taking it off the printer?</p>
<p>This is more of a theoretical question, because I can simply swap the nozzle, but still - eager to know.</p>

The best method is to have a scale on your microscope that looks like a ruler drawn in the optical path.  However I usually visually compare an unknown nozzle with known nozzles under a microscope.  If you don't have a microscope, you can get USB otoscope cameras (15mm focal length for looking in ears) for under $20.
You can get a fairly good idea of the size by telling the printer to extrude in air then measure the extrusion diameter with calipers.  Of course, it's better if you can compare with a known nozzle.  If you push the filament through by hand, the extrusion will be too thick.  With the stepper motor extruding, I measure the extrusion diameters between 0.3 and 0.5 mm on a 0.4 mm nozzle.  Low cost calipers are less than $20.  The main different with the low cost calipers is the slides are not smooth, reducing the accuracy in the 0.01 mm place.