{ }Free
Language and direction tags
Generate valid language and text-direction attributes.
Generate valid language and text-direction attributes. Validate a BCP 47 locale and produce escaped lang and dir attributes for an HTML element. Auto direction uses the base language against a small right-to-left language list.
How to use
- Enter your text, values, or image.
- Adjust the options and run the tool.
- Copy or download your result.
Worked example
Example input
BCP 47 language tag: ar Text direction: auto
Example result
lang="ar" dir="rtl"
Limitations and details
Automatic direction is language-based, not content analysis; mixed-direction text may need additional bidirectional markup.
Inputs and options
- BCP 47 language tag
- Text
- Text direction
- Auto / Left to right / Right to left
Frequently asked questions
Is this tool free and private?
Yes. All 300 tools are free in this phase. Processing happens in your browser; your input and files are not sent to our servers.