Works on this device
Microscopy Scale Bar Generator
Open a microscope image from your device, type how long one pixel is at the specimen, and the page draws a scale bar of the right length in pixels. Choose the corner, colour, size and label, then save the picture as a PNG. The picture is read and drawn in this browser; this page does not upload it.
Your image and its scale
PNG, JPEG, WebP, GIF or BMP, up to 50 MB and 8,192 pixels on a side. The picture is read in this browser and is not uploaded by this page.
Such as 0.325 µm per pixel, from your calibration or the microscope software.
A length you know in this image, such as 100 µm of a stage micrometer.
Measured in an image program, from one end to the other.
Automatic picks 1, 2 or 5 times a power of ten, at most a fifth of the image width.
Leave it empty for the length, such as 50 µm. Up to 40 characters.
Ready. Open a picture or choose Try an example.
Your picture
Your picture with its scale bar will show here.
- Size of the picture
- Size of one pixel
- Bar length
- Bar in pixels
- Length the drawn bar stands for
- Difference from the bar length
How to add a scale bar
- Choose Open a picture and pick a PNG, JPEG, WebP, GIF or BMP image from your device, or choose Try an example.
- Type the size of one pixel at the specimen, such as 0.325 µm per pixel. If you do not know it, choose I measure a known length in the image and type a length you know (such as 100 µm of a stage micrometer photographed with the same settings) and how many pixels long it is.
- Leave the bar length on Automatic, or choose My own length and type it, such as 50 µm.
- Choose the corner, the colour, the size, a box behind the bar if the image is busy, and the label.
- Check the picture under Your picture, then choose Download the PNG.
How the bar is worked out
- Bar in pixels = bar length ÷ size of one pixel, rounded to the nearest whole pixel (a half pixel rounds up). A 50 µm bar at 0.325 µm per pixel is 50 ÷ 0.325 = 153.85, so 154 pixels.
- Size of one pixel from a known length = known length ÷ its length in pixels, the same method as the Microscope Calibration Calculator. The page works with the exact decimals you type.
- Automatic length: the longest round length (1, 2 or 5 times a power of ten) that is not longer than a fifth of the image width.
- Because the bar is a whole number of pixels, it stands for a length a little different from the label. The page shows that length and the difference in percent: 154 pixels × 0.325 µm = 50.05 µm, which is 0.1% more than 50 µm.
- Sizes grow with the longer side of the image: bar thickness = longer side ÷ 160, label height = longer side ÷ 45, margin = longer side ÷ 50 (at least 2, 10 and 4 pixels), times 3/4 for small and 3/2 for large.
Worked example
The example picture is 1,200 × 800 pixels at 0.325 µm per pixel, so it is 1,200 × 0.325 = 390 µm wide. A fifth of that is 78 µm, so the automatic bar is 50 µm long: 50 ÷ 0.325 = 153.85, drawn as 154 pixels. At the medium size the bar is 1,200 ÷ 160 = 7.5, so 8 pixels thick, and the label is 27 pixels high.
Limits you should know
- The bar is only right if the size of one pixel is right. Calibrate with a stage micrometer for each objective, camera adapter and binning, and do not scale the image before you add the bar.
- Pictures up to 8,192 pixels on a side, 16,777,216 pixels in all and 50 MB. Most browsers cannot open TIFF files; save a TIFF as PNG first.
- The PNG has the size of your picture, but it does not keep the data of the original file (such as the scale stored by the microscope software). Keep your original file.
- Colours of the image are drawn by the browser; a picture with more than 8 bits per colour is saved with 8 bits.