How to Convert Inches to Pixels in HTML

When writing HTML code for Web pages, you may need to insert certain images that are of a certain pixel size. Unfortunately, images are sometimes expressed only in inches, which means that you'll have to convert the inch size to pixel size to ensure your code displays properly. Fortunately, this conversion is quite simple to do once you know the pixels per inch, or PPI, of your computer screen.

Open the picture you want to convert to pixels on your computer.

Right-click on the image and select "Image Properties." The size of the image in inches will be displayed. If you're using a software program, you can also find the size of the image by clicking on the "Image" menu and selecting "Properties."

Determine the PPI of your computer screen. Most monitors have a PPI of 72, but to make sure, check your computer's owner's manual.

Multiply the PPI by the inch-width and inch-height of the image. For example, if you have a 72 PPI computer monitor and a 6-by-8-inch photo, multiply 72 by 6 and 72 by 8. The size of the photo would be 432 by 576 pixels.

Things You'll Need

  • Computer's owner's manual
bibliography-icon icon for annotation tool Cite this Article

About the Author

Based in Halifax, Nova Scotia, Jordan Whitehouse has been writing on food and drink, small business, and community development since 2004. His work has appeared in a wide range of online and print publications across Canada, including Atlantic Business Magazine, The Grid and Halifax Magazine. Whitehouse studied English literature and psychology at Queen's University, and book and magazine publishing at Centennial College.