CSS Logical Properties Converter
Free, 100% client-side.
Loading tool...
What is CSS Logical Properties Converter?
The CSS Logical Properties Converter transforms physical CSS declarations like margin-top and padding-left into their logical equivalents like margin-block-start and padding-inline-start, following the CSS Logical Properties and Values specification. It also converts back to physical properties, resolving axes according to your chosen writing mode and text direction so LTR/RTL mirroring and vertical scripts map correctly.
Key Benefits
- Write one stylesheet that works in both left-to-right and right-to-left languages.
- Adapt layouts to vertical writing modes without extra rules.
- Modernize legacy CSS to spec-compliant logical properties.
- Convert logical properties back to physical for older browser support or tooling.
Common Use Cases
- β’Localizing a design system for Arabic or Hebrew markets.
- β’Building multilingual sites that share one CSS codebase.
- β’Refactoring legacy stylesheets to modern logical properties.
- β’Learning how block and inline axes map in different writing modes.
How to Use CSS Logical Properties Converter
- Paste your CSS: Paste the physical CSS declarations you want to convert, such as margin-left: 12px; or padding-top: 16px;.
- Choose conversion mode: Select Physical to Logical to modernize your CSS, or Logical to Physical to generate a fallback for older tooling.
- Set writing mode and direction: Pick horizontal-tb, vertical-rl, or vertical-lr, then choose LTR or RTL so inline start/end resolve correctly.
- Copy the result: Review the converted declarations and click Copy to paste them back into your stylesheet.
Key Features
- Two-way conversion: physical properties to logical and back again.
- Supports margin, padding, border, and inset longhand properties.
- Writing-mode aware: horizontal-tb, vertical-rl, and vertical-lr.
- Direction aware: flips inline-start/inline-end for LTR vs RTL.
- Handles corner radii like border-top-left-radius to border-start-start-radius.
- Flags shorthand declarations that need manual expansion first.