LabCanvas
Free account · save your work, full figure editorSign up free

Add a scale bar to a microscope image

A scale bar is its length divided by the pixel size: at 0.325 µm per pixel a 100 µm bar is 100 ÷ 0.325 = 307.7 pixels long. Open a micrograph (PNG, JPEG or TIFF), give the pixel size, read it from an ImageJ TIFF, or draw a line over something of known length such as an existing scale bar or stage micrometer and type its length. The tool picks a 1, 2 or 5 × 10ⁿ length that covers about 15–25 % of the width, or uses yours, and draws the bar with its label in the corner, colour, thickness and size you choose, with an optional box behind it. The PNG keeps the image’s pixel size and DPI, and nothing is uploaded.

What it does
Draws a calibrated scale bar on a microscope image from the pixel size (typed, read from an ImageJ TIFF, or measured by drawing over a known length) and downloads a PNG of the same size and DPI.
Formula
bar (px)=bar length (µm)pixel size (µm/px)pixel size=known lengthline length (px)
Example
A 1600 × 1200 px image at 0.325 µm per pixel is 520 µm wide; the automatic bar is 100 µm (19.2 % of the width), drawn 100 ÷ 0.325 = 307.7 ≈ 308 px long.

Last updated

FreeNo sign-upRuns in your browserFigures

Loading Scale bar adder…

At a glance

Scale bar adder at a glance
Formulabar (px)=length (µm)÷pixel size (µm/px)
Scale fromTyped pixel size, an ImageJ TIFF, or a line over a known length
Automatic length1,2 or 5×10n covering 15–25 % of the width (nearest 20 %)
InputPNG, JPEG, WebP or TIFF (8 or 16 bit)
OutputPNG with the same pixel size and DPI
Runs inYour web browser; nothing is uploaded
PriceFree, no account needed

What it does

How to use the scale bar adder

  1. Open the imageDrop a micrograph: PNG, JPEG or TIFF. An ImageJ TIFF with a scale fills in the pixel size by itself.
  2. Set the scaleType the pixel size (µm per pixel), or switch to drawing and drag along a feature of known length, such as the scale bar already burnt into the image or the marks of a stage micrometer, then type its length.
  3. Style and downloadKeep the automatic length or type one, choose the corner, colour, thickness, label and box, and download the PNG.

How it works

bar length (px)=bar length (µm)pixel size(µm per pixel)pixel size=known lengthlength of the linedrawn over it (px)line length (px)=(x2−x1)2+(y2−y1)2

The pixel size. Every scale bar starts from the length of specimen one pixel covers. It comes from the microscope (camera pixel × binning ÷ total magnification; the microscope pixel size calculator works it out), from the image file (ImageJ and Fiji save Analyze › Set Scale in the TIFF as pixels per unit, which this tool reads), or from the image itself: draw a line over something of known length and divide that length by the line’s length in pixels. A stage micrometer photographed with the same objective, camera adapter and binning is the reference for this (North 2006). Measure along as long a distance as possible: one pixel of error on a 300-pixel line is 0.3 %, on a 30-pixel line 3 %.

The bar length. The automatic length is the value of 1,2 or 5×10n (in µm) whose bar covers 15–25 % of the image width, the one nearest 20 % when several do; when none falls in that range, the one nearest 20 %. Round values are easy to read and to compare between panels. The bar is drawn in whole pixels, so its length is the exact value rounded to the nearest pixel; the result shows how far that is from exact (0.1 % for 307.7 → 308 px). The label is the length in the unit that reads best: nm below 1 µm, mm from 1000 µm.

Style. The bar is 1.2 % of the shorter image side thick and the label 4.5 % of it tall by default, which stays legible when the image is shrunk to a single journal column; type pixel values to override them. White on dark fluorescence images and black on bright-field images give the most contrast; a translucent box behind the bar keeps it readable over busy areas. Use the same bar length on every panel that is compared, place it where it hides no data, and state the length in the legend as well if the label is left off.

Why a scale bar. A magnification printed in the legend (for example “×400”) stops being true as soon as the figure is resized for the page or a screen; a scale bar is resized with the image and stays correct. In a survey of image-based figures in 15 journals each in plant sciences, cell biology and physiology, missing scale bars were among the most common problems, and the authors recommend a scale bar on every microscope image (Jambor et al. 2021).

The image keeps its pixel dimensions, and the DPI recorded in the original (PNG pHYs, JPEG JFIF/EXIF, TIFF tags) is written into the downloaded PNG. Sources: Jambor H, Antonietti A, Alicea B, et al. Creating clear and informative image-based figures for scientific publications. PLoS Biol 2021;19:e3001161, doi:10.1371/journal.pbio.3001161. North AJ. Seeing is believing? A beginners’ guide to practical pitfalls in image acquisition. J Cell Biol 2006;172:9–18, doi:10.1083/jcb.200507103.

Worked examples: a fluorescence image, a stage micrometer and an SEM image

1. Fluorescence image, pixel size known. A 1600 × 1200 pixel image of nuclei taken with a 6.5 µm camera pixel and a 20× objective: 6.5÷20=0.325 µm per pixel.

  1. The field is 1600×0.325=520 µm wide; 15–25 % of that is 78–130 µm.
  2. Of 1,2 and 5×10n only 100 µm falls in that range: 100 µm, 19.2 % of the width.
  3. Its length: 100÷0.325=307.7 pixels, drawn as 308 pixels (0.1 % long), 14 pixels thick (1.2 % of 1200), with a 54-pixel label “100 µm” above it in the bottom-right corner.

2. From a stage micrometer. With a 10× objective, a line drawn across ten 10 µm divisions (100 µm) measures 154 pixels: 100÷154= 0.6494 µm per pixel. On a 2048-pixel-wide image (1330 µm) the automatic bar is 200 µm (15.0 %), 200÷0.6494=308 pixels.

3. An SEM image with a scale bar burnt in. The data bar shows a 2 µm bar; drawn over, it measures 205 pixels, so the pixel size is 2÷205=9.756 nm. For a 1024-pixel-wide image (9.99 µm across) the automatic bar is 2 µm again (20.0 %), and the new bar can go where it does not cover the specimen.

Bar lengths in pixels for common pixel sizes
Pixel sizeTypical set-up10 µm50 µm100 µm
0.065 µm6.5 µm camera, 100×153.8 px769.2 px1538 px
0.1083 µm6.5 µm camera, 60×92.3 px461.5 px923.1 px
0.1625 µm6.5 µm camera, 40×61.5 px307.7 px615.4 px
0.325 µm6.5 µm camera, 20×30.8 px153.8 px307.7 px
0.65 µm6.5 µm camera, 10×15.4 px76.9 px153.8 px

Frequently asked questions

How do I add a scale bar to a microscope image?

You need the pixel size: from the microscope (camera pixel ÷ magnification), from the image file, or by measuring something of known length in the image. Then the bar is its length divided by the pixel size, in pixels. This tool does that and draws it: open the image, give the scale, and download the PNG.

How do I add a scale bar without knowing the pixel size?

Draw a line over something of known length in the image, such as the scale bar the microscope software burnt in, a stage micrometer image taken with the same objective, or a structure of known size, and type its length. The pixel size is that length divided by the line’s length in pixels.

How long should a scale bar be?

Long enough to read and short enough not to cover data: about 15–25 % of the image width, with a round value such as 10, 20, 50 or 100 µm. Use the same length on panels that are compared.

How do I add a scale bar in ImageJ or Fiji?

Set the scale with Analyze › Set Scale (pixel size, or a line over a known distance), then Analyze › Tools › Scale Bar… and choose the length, colour and position; flatten the overlay (Image › Overlay › Flatten) before saving. This tool does the same in the browser and reads the scale ImageJ saves in a TIFF.

Should the scale bar have a label?

Usually yes, with the length and unit next to the bar (for example 50 µm). Some journals prefer the length in the figure legend instead; then leave the label off and write “Scale bar, 50 µm” in the legend.

Does adding a scale bar change my image?

Only the pixels under the bar, label and box. The image keeps its size in pixels and its recorded DPI; keep the original unannotated file for analysis.

What pixel size does my microscope have?

Camera pixel size × binning ÷ total magnification: a 6.5 µm camera pixel behind a 20× objective covers 0.325 µm. The microscope pixel size calculator works it out, including from a stage micrometer or an SEM field width.

Measure and annotate in LabCanvas Image Analysis

Set the scale once and add scale bars, measure lengths and areas in µm and count particles in LabCanvas Image Analysis; free with a LabCanvas account.

Open Image Analysis