DevTools Logo

Golden Ratio Layout Calculator

Golden Ratio Layout Calculator

Split widths, reverse a known column, or build a φ type ladder — with a live proportion bar and CSS output.

Runs in your browser
Try an example

Input

φ = 1.6180 · exact

Click a segment in the results to subdivide it. Three levels are allowed; each segment stays at least 1 px.

The major side is total ÷ φ (61.8%); the minor side is the remainder. Rounding always preserves major + minor = total.

Proportions

1200 px total

Click a segment to split it again (depth 3 maximum).

Golden ratio values
SegmentRoundedExact
Major741.64 px741.64
Minor458.36 px458.36
Total1200 px—

Forward ladder

φ ladder values
StepValue
φ-3283.28 px
φ-2458.36 px
φ-1741.64 px
φ01200 px
φ11941.64 px
φ23141.64 px
φ35083.28 px
φ48224.92 px

CSS variables

:root {
  --phi: 1.6180;
  --w-major: 741.64px;
  --w-minor: 458.36px;
  --w-total: 1200px;
}

Examples

Split a content column

Input
1200 px → major 741.64 px, minor 458.36 px

The major share is 1200 / φ; the minor is the remainder, so the pair adds back to 1200.

Reverse from a sidebar

Input
minor 300 px → major 485.41 px, total 785.41 px

The reverse mode solves total = minor × (φ + 1), useful when the sidebar width is fixed.

Type ladder

Input
16 × φ⁰ = 16, ×φ¹ = 25.89, ×φ² = 41.89 px

A quick φ-based type ramp for headings and captions; no other scale ratio is assumed.

About this tool

Enter a width to get its φ split (major 61.8%, minor 38.2%). Reverse a known minor or major column, build a forward φ ladder or a type ramp from φ⁻³ to φ⁴, and choose exact, integer, even or grid rounding. The proportion bar can be subdivided up to three levels, and the rounded values are exported as CSS custom properties in your chosen unit. Rounding never breaks the invariant major + minor = total.

Everything runs locally in your browser — your inputs stay on your device and are never uploaded to a server.

What this tool does not do

  • Processes only the inputs provided in this session without connecting to external accounts or background servers.
  • Runs entirely in the current browser tab; nothing is synced across devices or backed up to a server.

How to use this tool

  1. Enter total width or segment size

    Input a container width (or known major/minor column) in px or rem.

  2. Inspect φ splits and type ladder

    View the 61.8% / 38.2% proportion bar, nested subdivisions, and modular type scale.

  3. Copy CSS custom properties

    Copy ready-to-use CSS variables or grid track definitions.

Use cases

Split a content column

The major share is 1200 / φ; the minor is the remainder, so the pair adds back to 1200.

Reverse from a sidebar

The reverse mode solves total = minor × (φ + 1), useful when the sidebar width is fixed.

Type ladder

A quick φ-based type ramp for headings and captions; no other scale ratio is assumed.

Common mistakes

Mistake:Should CSS grid and spacing values use exact decimals or whole pixels?

Fix:Fractional CSS units (fr, %, rem) handle exact φ ratios cleanly, while fixed pixel columns can be rounded to whole pixels with negligible visual change.

Mistake:How does a φ modular type scale work?

Fix:Multiplying a 16 px base size by powers of φ (16, 26, 42, 68 px) creates high-contrast display hierarchy suited for editorial hero headings.

Frequently asked questions

What is the golden ratio φ?

Phi (φ = (1 + √5) / 2 ≈ 1.618034) divides a total length into a major segment (≈ 61.8%) and minor segment (≈ 38.2%) such that total : major equals major : minor.

Should CSS grid and spacing values use exact decimals or whole pixels?

Fractional CSS units (fr, %, rem) handle exact φ ratios cleanly, while fixed pixel columns can be rounded to whole pixels with negligible visual change.

How does a φ modular type scale work?

Multiplying a 16 px base size by powers of φ (16, 26, 42, 68 px) creates high-contrast display hierarchy suited for editorial hero headings.

Can I compute the container width from a known sidebar width?

Yes. Reverse mode takes either the major or minor segment and solves for the matching partner dimension and combined container width.