References

Beginner-friendly references for web development, with live, editable examples.

The HTML <bdo> tag

Element All modern browsers Updated
Quick answer

The HTML <bdo> (bidirectional override) element forces the writing direction of its text, set by the required dir attribute (ltr or rtl). Use it to override the natural direction of characters; use <bdi> to merely isolate unknown-direction text.

Overview

The <bdo> (bidirectional override) element explicitly overrides the bidirectional algorithm, rendering its content in the direction set by its required dir attribute — ltr (left-to-right) or rtl (right-to-left).

It is rarely needed, but useful when you must force characters to display in a particular order regardless of their natural direction. Unlike <bdi>, which isolates text so its direction does not affect its surroundings, <bdo> actively sets the direction of its own contents.

Syntax

<bdo dir="rtl">This text is overridden.</bdo>

Attributes

The <bdo> element supports the following attributes, in addition to the global attributes available to every HTML element.

Attribute Value Description
dir ltr rtl auto Sets the text direction of content.

Example

Live example
<p>Normal, and <bdo dir="rtl">reversed by bdo</bdo>.</p>

Best practices

  • Use <bdo> only when you genuinely need to force a text direction.
  • Always include the required dir attribute (ltr or rtl).
  • For isolating unknown-direction text rather than forcing a direction, use <bdi>.
  • Avoid using it to fix layout issues that proper use of dir or <bdi> would solve more correctly.

Frequently asked questions

What is the bdo element for?
To override the text direction of its contents, rendering them in the direction given by the required dir attribute.
What is the difference between bdo and bdi?
<bdo> forces a specific direction; <bdi> isolates text so its direction does not affect its surroundings.
Is the dir attribute required on bdo?
Yes. <bdo> must have a dir of ltr or rtl to define the override.
When would I actually need bdo?
Rarely — mainly when displaying characters in a deliberately forced order, such as certain demonstrations of bidirectional text.