Tailwind to PX Converter

Convert Tailwind CSS spacing units to pixels, where each unit is 0.25rem (4px at the default base). When you see p-8 or gap-12 in markup and need the real pixel size, this resolves it instantly. The table below lists the common Tailwind-to-pixel mappings.

Tailwind spacing units to pixels (1 unit = 4px)

Tailwind unitPixels
14px
28px
312px
416px
520px
624px
832px
1040px
1248px
1664px

When to use it

  1. Find the pixel size of a Tailwind class like mt-6 or px-8.
  2. Reproduce a Tailwind layout in a non-Tailwind environment.
  3. Verify a Tailwind spacing value against a pixel design.

How to Use

  1. Type the Tailwind scale number into the Tailwind field — for example, 4 (for w-4).
  2. The pixel equivalent appears in the PX field instantly (4 × 4 = 16px).
  3. If you need a non-default base, change the Tailwind Unit field (default 4).
  4. Browse the full Tailwind scale in the reference table — every scale value with its pixel and class.
  5. Copy either field with one click for design notes or refactoring tasks.

Features

  1. Translates the full Tailwind default spacing scale (0 to 96) to pixels
  2. Full scale reference table including fractional values (0.5, 1.5, 2.5, 3.5)
  3. Bidirectional — Tailwind to PX or PX to Tailwind
  4. Configurable base for custom Tailwind configurations
  5. Local browser conversion — design data never leaves your machine

FAQs

How do I convert a Tailwind spacing class to pixels?

Multiply the scale unit by 4 (Tailwind's base unit). So w-4 = 4 × 4 = 16px, w-8 = 32px, w-12 = 48px, w-16 = 64px. Fractional values follow the same rule: w-0.5 = 2px, w-1.5 = 6px, w-3.5 = 14px. This calculator does the multiplication for you — type the Tailwind scale number (the part after w-, p-, m-, gap-) and read the pixel value.

Why convert Tailwind to pixels?

Mostly for design handoff and debugging. A designer working in Figma thinks in pixels; a developer using Tailwind thinks in scale units. When a component uses p-6 and the design spec calls for 28px padding, this calculator quickly confirms that p-6 = 24px (so the design and code disagree by 4px). It's also handy when porting Tailwind code to a non-Tailwind framework that needs raw pixel values.

What's the full Tailwind scale in pixels?

The default scale covers: 0 (0px), 0.5 (2px), 1 (4px), 1.5 (6px), 2 (8px), 2.5 (10px), 3 (12px), 3.5 (14px), 4 (16px), 5 (20px), 6 (24px), 7 (28px), 8 (32px), 9 (36px), 10 (40px), 11 (44px), 12 (48px), 14 (56px), 16 (64px), 20 (80px), 24 (96px), 28 (112px), 32 (128px), 36 (144px), 40 (160px), 44 (176px), 48 (192px), 52 (208px), 56 (224px), 60 (240px), 64 (256px), 72 (288px), 80 (320px), 96 (384px). The reference table below shows the full scale at a glance.

Does this account for a custom tailwind.config.js spacing scale?

No — this calculator assumes Tailwind's default 4px base. If your project extends or overrides the spacing scale in tailwind.config.js, your custom values won't appear in the reference table. The arithmetic still works (just override the base in the field above), but the named classes in the table reference the default scale only.

Technical Details

Inverse of PX→Tailwind: px = Tailwind units × 4. The full Tailwind v3 scale is displayed in a reference table, mapping each spacing value (0, 0.5, 1, 1.5... 96) to its pixel equivalent. The class name column shows the corresponding w-{n} class. This is useful for developers debugging CSS or translating design specs from Tailwind classes to absolute pixel dimensions.

Calculators & Converters

Calculators & Converters

  • Golden Ratio Calculator
  • Cost Estimation Calculator
  • Universal Converter
  • Notepad Calculator
  • Mileage Calculator
  • Land Area Converter (Marla, Kanal, Acre)
  • Tire Size Calculator
  • Depth of Field Calculator