# Add a scale bar to a microscope image

> Add a scale bar to a micrograph in your browser: set µm per pixel or draw over a known length, pick an automatic or own length, style it, download a PNG.

URL: https://www.labcanvas.com/tools/scale-bar-adder

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.

## Quick answer

- **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 length ÷ line 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.

Free, in the browser, no account needed. Updated 2026-10-19.

## Features

- Pixel size typed in nm, µm or mm per pixel, read from an ImageJ/Fiji TIFF (Set Scale), or measured by drawing a line over a known length
- Automatic bar length: a \(1, 2 \text{ or } 5 \times 10^n\) value covering about 15–25 % of the image width, or any length you type
- Label in nm, µm or mm above or below the bar, or no label; bold or regular
- Five positions, any colour, thickness and label size in pixels, margin, and a dark or light box behind the bar
- Opens TIFF (8 or 16 bit) as well as PNG and JPEG
- Same pixel size and recorded DPI as the original; processed in your browser

## How to use it

1. **Open the image**: Drop a micrograph: PNG, JPEG or TIFF. An ImageJ TIFF with a scale fills in the pixel size by itself.
2. **Set the scale**: Type 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 download**: Keep the automatic length or type one, choose the corner, colour, thickness, label and box, and download the PNG.

## At a glance

| | |
| --- | --- |
| Formula | \(\text{bar (px)} = \text{length (µm)} \div \text{pixel size (µm/px)}\) |
| Scale from | Typed pixel size, an ImageJ TIFF, or a line over a known length |
| Automatic length | \(1, 2 \text{ or } 5 \times 10^n\) covering 15–25 % of the width (nearest 20 %) |
| Input | PNG, JPEG, WebP or TIFF (8 or 16 bit) |
| Output | PNG with the same pixel size and DPI |

## How it works

$$\text{bar length (px)} = \frac{\text{bar length (µm)}}{\begin{gathered}\text{pixel size} \\ \text{(µm per pixel)}\end{gathered}}$$

$$\text{pixel size} = \frac{\text{known length}}{\begin{gathered}\text{length of the line} \\ \text{drawn over it (px)}\end{gathered}}$$

$$\begin{aligned} &\text{line length (px)} \\ &\quad = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2} \end{aligned}$$

**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](https://www.labcanvas.com/tools/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 \text{ or } 5 \times 10^n\) (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](https://doi.org/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](https://doi.org/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 \div 20 = 0.325\) µm per pixel.

- The field is \(1600 \times 0.325 = 520\) µm wide; 15–25 % of that is 78–130 µm.
- Of \(1, 2 \text{ and } 5 \times 10^n\) only 100 µm falls in that range: **100 µm**, 19.2 % of the width.
- Its length: \(100 \div 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 \div 154 =\) **0.6494 µm per pixel**. On a 2048-pixel-wide image (1330 µm) the automatic bar is 200 µm (15.0 %), \(200 \div 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 \div 205 = 9.756\ \mathrm{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.

| Pixel size | Typical set-up | 10 µm | 50 µm | 100 µm |
| --- | --- | --- | --- | --- |
| 0.065 µm | 6.5 µm camera, 100× | 153.8 px | 769.2 px | 1538 px |
| 0.1083 µm | 6.5 µm camera, 60× | 92.3 px | 461.5 px | 923.1 px |
| 0.1625 µm | 6.5 µm camera, 40× | 61.5 px | 307.7 px | 615.4 px |
| 0.325 µm | 6.5 µm camera, 20× | 30.8 px | 153.8 px | 307.7 px |
| 0.65 µm | 6.5 µm camera, 10× | 15.4 px | 76.9 px | 153.8 px |

## 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.
