Inches to Px Converter: Supply the PPI Before Counting Pixels

“Make it four inches wide” is not enough to specify a raster image's pixel width. At 240 pixels per inch, the target is 960 pixels.

At 120 pixels per inch, it is 480 pixels.

An inches to px converter needs an explicit PPI input and a clear statement of what is fixed. Are you planning new target pixel dimensions, or keeping an existing pixel count and changing its physical-size interpretation?

This original numeric brief uses a proposed 4 × 3-inch raster at 240 PPI. It calculates dimensions without creating, inspecting, exporting, or resampling an image. Actual artwork and the output provider's requirements remain in the native image brief.

Inches to pixels
Inches to pixels
Open the full example ↗

Multiply each physical dimension by the supplied PPI

PPI means pixels per inch in this raster-size calculation. The axis formulas are:

Width in pixels = width in inches × PPI.

Height in pixels = height in inches × PPI.

Adobe describes this relationship between pixel dimensions, physical size, and resolution, and distinguishes resizing with and without resampling. Adobe, Image Size, Resolution, and Resampling.

For the supplied brief:

Field Worked value
Physical target W 4 in × H 3 in
Supplied density 240 PPI
Width calculation 4 × 240 = 960 px
Height calculation 3 × 240 = 720 px
Total pixel count 960 × 720 = 691200 pixels

Keep the PPI and physical dimensions with the result. “960 pixels wide” alone does not explain which physical target and density produced it.

Compare a new target with a fixed-pixel case

If you keep the physical target at 4 × 3 inches but supply 120 PPI, the new target becomes 480 × 360 pixels, totaling 172800 pixels. Both axes are halved, so the total pixel count is one quarter of 691200.

Now consider a different question: keep the 960 × 720 existing pixel count and interpret it at 120 PPI. Divide each pixel dimension by that PPI:

  • Width: 960 / 120 = 8 inches.
  • Height: 720 / 120 = 6 inches.
  • Pixel count: still 691200.
What is held fixed? PPI Result
Physical target 4 × 3 in 240 New target 960 × 720 px
Physical target 4 × 3 in 120 New target 480 × 360 px
Pixel dimensions 960 × 720 120 Physical interpretation 8 × 6 in; pixels unchanged

The last row describes a metadata/size relationship without resampling. Adobe explains that this operation retains pixel dimensions, while resampling changes the pixel data. Adobe.

The calculator's number is a plan, not an image edit. Changing its PPI field does not alter a file. Keep the fixed-pixel comparison visually separate from the new-target calculation so the two results cannot be mistaken for the same action.

Show what whole-pixel rounding changes

A requested dimension can produce a fractional target pixel count. For 4.01 inches at 240 PPI, the mathematical target is 962.4 pixels.

This example design rounds to the nearest whole pixel, with positive half values rounded up. The proposed width is therefore 962 pixels. Dividing that width by 240 gives approximately 4.008333333 inches, not exactly 4.01 inches.

Show the requested inch dimension, raw target, whole-pixel rounding rule, rounded target, and implied physical dimension together. A result that says “4.01 in = 962 px exactly” would conceal the rounding difference.

When both axes are rounded, calculate total pixels from the rounded integer width and height. Keep that total distinct from the product of fractional target counts.

The chosen rounding policy does not guarantee that the output provider accepts the resulting size. Confirm the required dimensions and tolerances through the actual artwork workflow.

Require the basis instead of guessing it

For this example, physical dimensions and PPI must be positive finite numbers. Blank PPI is missing input; it must not silently become 72 or 96. Zero, negative, nonfinite, and malformed entries should show a field-specific error rather than a result.

Clear the old answer when an input or comparison mode changes. If the user calculates 960 × 720 and then deletes PPI, the earlier dimensions must disappear. Do not leave a valid-looking answer beside an invalid basis.

This brief concerns raster pixel dimensions and a supplied physical-size/PPI relationship. Do not treat its pixels as CSS layout units or assume that a screen-rendered inch proves a measured physical inch. It does not establish printer conditions, display density, or a quality recommendation.

Keep the provider's actual PPI requirement in the native brief; 240 is an illustrative input here, not a universal print standard.

Copy this prompt for the complete numeric planner

Create an original self-contained offline HTML raster-size numeric
planner in US English, with all necessary local code in one file.
No file upload, image inspection, resampling, export, accounts,
network calls, storage or actual artwork creation.

Primary mode: physical width/height in inches plus required supplied
PPI. Inputs must be positive finite numbers using US dot-decimal
notation. Reject blank, zero, negative, nonfinite or malformed input.
Do not default missing PPI to 72 or 96. State that this is a raster
size plan, not CSS/device-pixel or screen physical-inch measurement.

Show width inches*PPI and height inches*PPI as raw targets.
Declare nearest-whole-pixel rounding, positive halves up. Show rounded
integer dimensions and their total width*height pixel count.
Show each rounded dimension/PPI as its implied physical size;
label shortened fractional displays approximate and retain derivation.
Do not claim a rounded result exactly equals requested inches.

Separate fixed-pixel comparison mode: supplied positive integer
pixel width/height plus positive PPI; physical size=pixels/PPI.
This mode retains pixel count and explains no-resampling metadata
interpretation. It does not edit a file or produce new image data.

Original worked checks:
4 x 3 inches at 240 PPI => 960 x 720 pixels, total 691200.
Same 4 x 3 inches at 120 PPI => 480 x 360 pixels, total 172800.
Fixed 960 x 720 pixels at 120 PPI => 8 x 6 inches, total 691200.
4.01 inches at 240 PPI => raw 962.4 pixels, rounded 962;
962/240 approximately 4.008333333 inches, not exactly 4.01.
Blank PPI must give error and remove the previous answer.

Keep mode, supplied units/PPI, raw/rounded values and plain-text
calculation record visible. Clear stale results on every input/mode
change. Use accessible errors, keyboard controls, visible focus and
readable narrow-screen layout. Detect unsupported/overflowing results
instead of displaying a nonfinite answer.
No universal PPI or print-quality guarantee; actual provider
requirements/tolerances unknown. Return the complete file, worked
record and manual checks; do not claim it was tested unless run.

Check the generated planner with both 120-PPI cases before using its target. The result should say whether it changed the planned pixel count or merely described a different physical size for fixed pixels.

Review the size basis in NOS

NOS can save and render prepared HTML. An educational companion can place the physical target, supplied PPI, and resulting pixel dimensions beside the fixed-pixel comparison. That makes the two kinds of size question easier to review.

Keep actual artwork and provider specifications in the native image workflow, and verify any generated local calculation against the worked brief. Explore NOS.

Keep reading