Conversion Form

CH
PX

About the Unit

CH: The ch unit is a relative typographic unit based on the width of the '0' character of the current font. This unit is especially useful when you want the width of an element to be proportional to the text content, particularly for input fields or text areas. Using ch ensures that the element size adjusts based on the average character width of the current font, providing precise control over text layout. For example, if you set the width of a text input field to 10ch, it will be wide enough to accommodate 10 '0' characters of the font, making it useful for password fields or numeric inputs. The ch unit is less commonly used than other relative units like em or rem, but it is an excellent choice when precise width based on textual content is needed.

Pro Tip: chpx

Ch is based on the width of the '0' character. Convert ch to px for fixed text measurements.

Quick Reference: Unit Conversion by Tens

CHPX
10ch80px
20ch160px
30ch240px
40ch320px
50ch400px
60ch480px
70ch560px
80ch640px
90ch720px
100ch800px
110ch880px
120ch960px
130ch1040px
140ch1120px
150ch1200px
160ch1280px
170ch1360px
180ch1440px
190ch1520px
200ch1600px
210ch1680px
220ch1760px
230ch1840px
240ch1920px
250ch2000px

Live Unit Preview

See how different CSS units affect the size of the box below:

10px

10rem

10em

10%

10vw

10vh

Common Mistake

Be cautious when mixing ch and px without testing on different screen sizes.

Real Code Example

/* Mobile-first card with ch → px */
.card {
  padding: 0ch;     /* undefinedpx */
  font-size: 1.5rem;
  width: min(90vw, 40ch);
}
Unidade não encontrada.

Keyboard Shortcuts

  • Ctrl + C: Convert
  • Ctrl + I: Invert units
  • Esc: Reset values

More popular conversions