Free developer tool

CSS Logical Properties Converter

Convert physical CSS properties like margin-left and text-align:left into their logical equivalents, or reverse the conversion, so your styles adapt to any writing direction.

Physical CSS input
Logical CSS output
Ready. Paste CSS on the left to convert it live.

Write-once styles for any direction

Stop maintaining separate left/right overrides for RTL languages and vertical writing modes.

Real mapping table

Every recognized physical property maps to its exact logical equivalent, not a guess.

Two-way conversion

Convert physical to logical, or logical back to physical assuming left-to-right.

Copy in one click

Grab the converted CSS instantly with a status confirmation.

How to use the logical properties converter

  1. Pick a directionChoose Physical → Logical to modernize your CSS, or Logical → Physical to see the LTR equivalent.
  2. Paste your CSSDrop declarations using margin, padding, border, inset, text-align or float into the input pane.
  3. Copy the resultReview the converted CSS on the right and select Copy CSS to grab it.

About CSS logical properties

Physical CSS properties like margin-left, padding-right or text-align: left describe a fixed direction on screen, which works fine for left-to-right languages but breaks down the moment a page needs to support Arabic, Hebrew, or a vertical writing mode used in some East Asian typography. Logical properties solve this by describing direction relative to the flow of content instead: inline-start means "the start of a line of text," and block-start means "the start of the block direction," so the same declaration automatically points left in an LTR page and right in an RTL page, with no extra stylesheet or JavaScript required. Adopting logical properties is largely a mechanical rename, which is exactly what this converter automates in both directions, and the reference table below lists every mapping the tool understands so you can check any property by hand too.

PhysicalLogical
margin-leftmargin-inline-start
margin-rightmargin-inline-end
margin-topmargin-block-start
margin-bottommargin-block-end
padding-leftpadding-inline-start
padding-rightpadding-inline-end
padding-toppadding-block-start
padding-bottompadding-block-end
border-left / -width / -style / -colorborder-inline-start (+ suffix)
border-right / -width / -style / -colorborder-inline-end (+ suffix)
border-top / -width / -style / -colorborder-block-start (+ suffix)
border-bottom / -width / -style / -colorborder-block-end (+ suffix)
leftinset-inline-start
rightinset-inline-end
topinset-block-start
bottominset-block-end
text-align: lefttext-align: start
text-align: righttext-align: end
float: leftfloat: inline-start
float: rightfloat: inline-end
clear: leftclear: inline-start
clear: rightclear: inline-end

CSS logical properties converter FAQ

What are CSS logical properties?

Logical properties describe direction relative to the document's writing mode and text direction, using terms like inline-start and block-end instead of left, right, top and bottom.

Why use logical properties instead of physical ones?

Logical properties automatically adapt when a page switches to a right-to-left language or a vertical writing mode, so you don't need separate stylesheets or overrides for each direction.

Does this converter assume left-to-right when reversing?

Yes. When converting logical back to physical, this tool assumes a standard horizontal left-to-right writing mode, which is the most common default.

Which properties does this tool convert?

It covers margin, padding and border left/right/top/bottom variants, the inset properties, text-align values of left and right, and float and clear values of left and right.

Try other CSS tools

Keep building with these free online CSS generators.