Skip to content

Bidi (bidirectional text)

Text that mixes right-to-left and left-to-right runs, such as Arabic with phone numbers.

An Arabic signature still contains left-to-right pieces: phone numbers, email addresses, URLs and Latin brand names. The Unicode bidirectional algorithm decides how they are ordered.

Without help, a number like +971 50 555 0142 can come out scrambled, with the plus sign at the wrong end. Wrapping each number in a span with dir="ltr" keeps it in order.

Related terms