Image DPI Changer
A JPEG or a PNG holds a grid of pixels and, separately, a small number saying how many of those pixels go in an inch of paper. A printer, a print shop or a submission form asks for that number, and it can be changed without touching a single pixel. This page does exactly that and nothing more: it rewrites the resolution field and copies every other byte of the file through in the order it arrived, so the image is never decoded, resampled or saved again. What is different here is the plural. One file can state a resolution in several places that disagree: a JPEG's JFIF header, the XResolution field of its EXIF block and the ResolutionInfo of a Photoshop block, or a PNG's pHYs chunk, an eXIf block and an sCAL physical scale. Set one and leave the others and the file prints at the old size in one application and the new size in another. So every field this tool can read is written to the same number, a field that cannot be brought into agreement is removed and named in a table with the reason, and a block whose own offsets point outside itself is left exactly as it arrived and named too. The compressed image data is pulled out of the file that went in and the file that came back and compared byte for byte, so the claim that nothing was resampled is checked rather than asserted. Before you open anything the page is still the arithmetic you probably came for: type a pixel size and a resolution and it shows the print size in inches and centimetres. Nothing is uploaded, there is no account, and no size limit is imposed because the file never leaves the tab it was opened in.
- DPI
- Pixels
- x
- Print size
- 8.27 x 11.69 in, 21 x 29.7 cm
- Was
- no file open
2,480 x 3,508 pixels at 300 DPI print at 8.27 x 11.69 in, which is 21 x 29.7 cm.
Nothing is open yet, so the numbers above are the arithmetic on their own: or drop one on the stage and the pixel size is read from the file, the stored resolution appears under Was, and the Download button writes a copy with the new one.
- prints 8.27 x 11.69 in
- prints 34.44 x 48.72 in
- 11,811 pixels per metre
Those three lines are worked out by the same code the tool runs on, so they cannot drift from what it does. JPEG and PNG are changed. No size limit is imposed, since nothing is uploaded: the ceiling is the memory of the browser you are using.
Common questions
- Does changing the DPI reduce the quality of the image?
- No, because nothing about the picture is touched. A JPEG is a chain of segments and a PNG is a chain of chunks, and the resolution sits in its own block beside the compressed picture rather than inside it. This tool copies the file through with that one block rewritten: the quantisation and Huffman tables, the frame header and the compressed scan of a JPEG, or the header, palette and every IDAT block of a PNG, are written out untouched. Nothing is decoded and nothing is encoded again, so there is no second round of JPEG loss and no resampling. The page does not simply assert that: it pulls the compressed image data out of both files, compares them byte for byte, and only then says the pixels are unchanged.
- Where is the DPI actually stored in a JPEG and in a PNG?
- A JPEG usually keeps it in the JFIF header, the APP0 segment near the front of the file, as a unit byte (per inch or per centimetre) and two two-byte numbers. It can also carry XResolution, YResolution and ResolutionUnit inside the EXIF block in APP1, and a Photoshop file adds a ResolutionInfo block in APP13. A PNG has no JFIF header at all: it uses a pHYs chunk holding pixels per metre, and it may also carry an EXIF block in an eXIf chunk or a physical scale in sCAL. This page reads all of them, sets every one it can read to the same number, and lists each field with what it stated before and what it states now.
- How do I make an image 300 DPI for printing?
- Open it, type 300 in the DPI box and download the copy. The file name comes back with the resolution in it, for example poster-300dpi.jpg. What that does is tell the printer how large to lay the pixels out: at 300 DPI an image 2,480 by 3,508 pixels asks to print at 8.27 by 11.69 inches, which is 21 by 29.7 centimetres, or A4. What it cannot do is add detail that was never captured. If a print shop says an image is too low resolution, it is usually saying the pixel count is too small for the size wanted, and the fix is a larger original, not a larger number in the header.
- How many pixels do I need for the print size I want?
- Multiply the size in inches by the resolution. A 4 by 6 inch photo at 300 DPI needs 1,200 by 1,800 pixels; an 8 by 10 needs 2,400 by 3,000. Going the other way, divide: 3,000 pixels at 300 DPI print 10 inches wide, and the same 3,000 pixels at 72 DPI ask for 41.67 inches. The boxes at the top of this page do that arithmetic before any file is open, in inches and in centimetres, and the three worked examples under the stage are computed by the same code the tool runs on.
- Why does another application still show the old resolution?
- Almost always because the file states it in more than one place and that application reads a different one. That is the case this tool exists for: it writes every field it can read at once rather than only the first. Two things are still worth knowing. If an EXIF or eXIf block has internal offsets pointing outside itself, it is not rewritten, because a half patched block is worse than an untouched one; the page says so in a note and leaves that block exactly as it arrived. And some applications ignore the stored resolution altogether and use their own default, commonly 72 or 96, until you set the size in their own print dialogue.
- Why does a PNG come back at 299.9994 instead of 300?
- Because of the format, not the arithmetic. A PNG's pHYs chunk stores a whole number of pixels per metre, and 300 dots per inch is 11,811.02 pixels per metre, so the nearest whole number, 11,811, is what gets written. Read back that is 299.9994 dots per inch, which rounds to 300 and is what applications show. The page says the exact number it wrote rather than hiding the rounding. A JPEG has no such problem: its JFIF header stores whole dots per inch, so 300 is stored as 300 exactly.
- Which files can it change, and how large can they be?
- JPEG and PNG. A GIF, WebP, PDF, TIFF, HEIC, AVIF or BMP is named and refused rather than half rewritten, because each keeps its resolution somewhere this tool does not take apart, and a GIF states none at all. No size limit is imposed, because nothing is uploaded and there is no compute to pay for: the practical ceiling is the memory of the browser you are using. Resolutions from 1 to 65,535 are accepted, which is the range a JFIF density field can hold, and a value with a decimal point is refused rather than quietly rounded.
- Is my image uploaded anywhere?
- No. The file is read by this page with a FileReader and rewritten in your own browser, so there is no server in this, no account to make and no request of any kind. The picture is never written to local storage either. The only things the page remembers are the three numbers in the boxes, the resolution and the pixel size you typed, and the Start over button above the tool forgets them. A damaged file is refused with the reason and the byte the trouble is at, and your original is never modified: what you get is a copy to download.
Only the resolution field is changed: the pixels are copied through untouched, so the image is not resampled and loses no detail. Changing it changes the size the file asks to print at, never how much detail is in it.