Calculate characters per inch from line width and whole character count, or find whole-character capacity and required line width from CPI. Use the usable text width after margins and include spaces consistently in the count.

Count characters, including spaces, across the measured line. Proportional-font CPI is an average for that text.

Characters Per Inch Formula

The following formula is used to calculate the characters per inch (CPI) from a measured line length.

CPI = Characters / Line Width (in)

Variables:

  • CPI is the characters per inch
  • Characters is the number of characters across the line
  • Line Width is the horizontal length of that line in inches

To calculate characters per inch, divide the whole character count by the measured line width in inches. For uniform character pitch, the number of complete character cells that fit is CPI ร— width, rounded down; required width is character count / CPI. For a proportional font, CPI is an average for the specific text measured and does not predict arbitrary text exactly.

What is Characters Per Inch?

Characters per inch (CPI) describes how many characters fit horizontally into one inch of space. It is commonly used for monospaced fonts (typewriter-style โ€œpitchโ€), and it can also be used as an average measure for proportional fonts when you count characters across a known line length. CPI is useful for estimating line lengths, columns, and layout constraints.

How to Calculate Characters Per Inch?

The following steps outline how to calculate the Characters Per Inch.


  1. First, determine the line width in inches.
  2. Next, determine the number of characters across that line.
  3. Use the formula CPI = Characters / Line Width (in).
  4. Finally, calculate the Characters Per Inch (CPI).
  5. After inserting the variables and calculating the result, check your answer with the calculator above.

Example Problem : 

Use the following variables as an example problem to test your knowledge (CPI = 240 / 6 = 40).

Line Width (inches) = 6

Number of Characters = 240