Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

px, pt, em conversion table


May 04, 2021 HTML Reference Manual



pt (point, point): is a physical length unit, which refers to 72ths of an inch.

px (pixels): is a virtual length unit, is a computer system's digital image length units, if px to convert to a physical length, you need to specify the accuracy of DPI (Dots Per Inch, pixels per inch), in the scanning and printing is generally optional DPI. The default for Windows is 96dpi, and the default for Apple is 72dpi.

em (relative length unit, font size relative to text within the current object): is a relative length unit that initially refers to the width of the letter M, so the name em. N ow refers to the character width of the multiply, usage of similar percentages, such as: 0.8em, 1.2em, 2em and so on. Usually 1em is 16px.

Word size: is Chinese unit in the word library, with a Chinese code to represent a specific point value pt, easy to remember, express.

The conversion formulas for pt and px can be derived from the definition of pt:

pt=1/72(英寸), px=1/dpi(英寸)

So pt=px*72/dpi

Based on 96dpi under Windows, pt=px*72/96=px*3/4

Size Pt Px Em

First no

42pt

56px

3.5em

Xiaochu

36pt

48px

3em

34pt

45px

2.75em

32pt

42px

2.55em

30pt

40px

2.45em

29pt

38px

2.35em

28pt

37px

2.3em

27pt

36px

2.25em

Number one

26pt

35px

2.2em

25pt

34px

2.125em

Small one

24pt

32px

2em

Number two

22pt

29px

1.8em

20pt

26px

1.6em

So young two

18pt

24px

1.5em

17pt

23px

1.45em

Number three

16pt

22px

1.4em

Small three

15pt

21px

1.3em

14.5pt

20px

1.25em

Number four

14pt

19px

1.2em

13.5pt

18px

1.125em

13pt

17px

1.05em

Small four

12pt

16px

1em

11pt

15px

0.95em

Number five

10.5pt

14px

0.875em

10pt

13px

0.8em

Small five

9pt

12px

0.75em

8pt

11px

0.7em

Number six

7.5pt

10px

0.625em

7pt

9px

0.55em

Small six

6.5pt

8px

0.5em

Number seven

5.5pt

7px

0.4375em

Number eight

5pt

6px

0.375em