XTools Logo
XTools
Blog
/
JSON Formatter & YAMLXML FormatterCode Formatter & MinifierJSON to TypeScriptMarkdown ⇄ HTMLMermaid Diagram EditorRegex TesterJWT DecoderUUID GeneratorEncode & DecodeCron Expression BuildercURL Command BuilderMeta Tag GeneratorPX to REM & Line HeightCSS GeneratorChmod Calculator

© 2026 XTools. All rights reserved.

Privacy PolicyContact Us

    PX to REM & Line Height

    Convert px, rem, em, and pt, and get a readable line height for any font size
    • Files never leave your device
    • Runs in your browser
    • Free, no sign-up, no watermark

    Converter

    Type in any box, the rest follow.

    Preview

    Typography is the craft of making language visible. A good line length and generous leading let the eye glide from one line to the next without losing its place.

    Common sizes

    Click a row to load it into the converter.
    pxrememptvwLine-height
    100.6250.6257.50.6941.7
    120.750.7590.8331.65
    130.81250.81259.750.9031.63
    140.8750.87510.50.9721.6
    150.93750.937511.251.0421.57
    1611121.1111.55
    181.1251.12513.51.251.52
    201.251.25151.3891.5
    241.51.5181.6671.4
    281.751.75211.9441.32
    3222242.2221.25
    362.252.25272.51.23
    402.52.5302.7781.2
    4833363.3331.15
    563.53.5423.8891.13
    6444484.4441.1
    724.54.55451.09
    9666726.6671.05

    Type scale

    px
    +6 · 61pxThe quick brown fox3.815rem
    +5 · 48.8pxThe quick brown fox3.052rem
    +4 · 39.1pxThe quick brown fox2.441rem
    +3 · 31.3pxThe quick brown fox1.953rem
    +2 · 25pxThe quick brown fox1.563rem
    +1 · 20pxThe quick brown fox1.25rem
    0 · 16pxThe quick brown fox1rem
    -1 · 12.8pxThe quick brown fox0.8rem
    -2 · 10.2pxThe quick brown fox0.64rem

    Fluid type with clamp()

    Text grows smoothly between two viewport widths and stays fixed outside them.

    px
    px
    px
    px
    font-size: clamp(1rem, 0.8239rem + 0.7512vw, 1.5rem);

    The quick brown fox

    At 375 px wide
    16px
    At 768 px wide
    18.95px
    At 1024 px wide
    20.88px
    At 1440 px wide
    24px

    Context

    px

    The <html> font size that rem is based on. Browsers default to 16 px.

    px

    What em and % are relative to.

    px

    Recommended line-height

    1.433.6px

    Body text reads best around 1.5. Larger sizes need less leading.

    Snapped to a 4 px grid1.333 · 32px
    font-size: 1.5rem;
    line-height: 1.4;

    Comfortable line length

    45–75 characters per line. Set max-width to about 66ch (≈ 792px).

    Related tools

    • JSON Formatter & YAML
    • XML Formatter
    • Code Formatter & Minifier
    • JSON to TypeScript
    • Markdown ⇄ HTML
    • Mermaid Diagram Editor
    • Regex Tester
    • JWT Decoder
    • UUID Generator
    • Encode & Decode
    • Cron Expression Builder
    • cURL Command Builder
    • Meta Tag Generator
    • CSS Generator
    • Chmod Calculator

    How to use PX to REM & Line Height

    Convert between px, rem, em, pt, %, and vw using your own root and parent font sizes, and get a recommended line height and line length for any size. The page also builds a modular type scale and a fluid clamp() rule for responsive text.

    1. 1

      Set the Root font size, Parent font size, and Viewport width under Context.

    2. 2

      Type a value into any box in Converter; the other units follow.

    3. 3

      Read the Recommended line-height and Comfortable line length for that size.

    4. 4

      Optional: build a Type scale from a ratio, or a Fluid type with clamp() rule, and copy the CSS.

    Frequently asked questions

    How many pixels is 1rem?

    1rem equals the root (<html>) font size, which browsers set to 16 px by default. Change Root font size if your site uses a different base.

    What's the difference between rem and em?

    rem is relative to the root font size; em and % are relative to the parent element's font size. Set Parent font size to convert em correctly.

    How is the line height chosen?

    It follows common typographic practice: about 1.5 for body text and tighter leading for large headings. A version snapped to a 4 px grid is shown as well.

    What does the clamp() generator do?

    It writes a font-size that grows smoothly between a min and max size across two viewport widths and stays fixed outside them. Simulate viewport width shows the result at any width.

    Can I convert points for print?

    Yes. pt uses the CSS ratio of 72 pt to 96 px, so 12 pt equals 16 px.