Vietnamese Text Tools API

Remove Vietnamese accents, convert TCVN3 (ABC) and VNI-Windows text to Unicode, Telex / VNI typing to letters, fix tone marks, split and sort names.

GETPOSThttps://apibox.io.vn/v1/vn-text

The Vietnamese text API gathers the conversions that Vietnamese software keeps needing. remove_accents turns “Tiếng Việt” into “Tieng Viet” (with slug=true for URLs). to_unicode converts text typed with the legacy TCVN3 / ABC fonts (.VnTime: “ViÖt Nam”) or VNI-Windows fonts (“Vieät Nam”) into Unicode; with from=auto it detects the encoding, which fixes old Word and Excel files and data exported from legacy systems.

telex and vni_typing turn keystrokes into letters (“Tieengs Vieetj” → “Tiếng Việt”, “Tie6ng1” → “Tiếng”), useful for search boxes and keyboards without an input method. normalize recomposes NFD text (common in files from macOS) and places tone marks consistently in the old style (hòa, thúy) or the new style (hoà, thuý) with tone_style=new, so that the same word always compares equal.

split_name splits full names into family, middle and given names (recognising compound family names such as Tôn Thất) and fixes their capitalisation; send one name per line for a batch. sort_names sorts a list the Vietnamese way: by given name, then middle name, then family name, with Vietnamese alphabetical order (a ă â … đ …).

Parameters

NameInTypeRequiredDefault
actionbody|querystringnoremove_accentsremove_accents, to_unicode, telex, vni_typing, normalize, split_name or sort_names.
textbody|querystringyesThe text (max 200,000 characters). For names: one per line.
frombody|querystringnoautoFor to_unicode: auto, tcvn3 or vni.
tone_stylebody|querystringnooldold (hòa) or new (hoà).
namesbodyarraynoFor sort_names: an array of names (or one per line in text).
slugbody|querybooleannoWith remove_accents: return a URL slug.

Example

curl -X POST "https://apibox.io.vn/v1/vn-text" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"action":"to_unicode","text":"Vieät Nam"}'

Response

{
  "action": "to_unicode",
  "from": "vni",
  "detected": true,
  "length": 8,
  "result": "Việt Nam"
}

Use cases

  • Convert old TCVN3 / VNI documents and database exports to Unicode
  • Accent-insensitive search and URL slugs
  • Sort class lists and staff lists by given name
  • Normalise names and addresses before de-duplicating

FAQ

Can capital letters in TCVN3 be converted?

TCVN3 capitals with tone marks were drawn by a separate font (.VnTimeH) using the lowercase codes, so they come out as lowercase letters; only Ă Â Đ Ê Ô Ơ Ư have their own codes.

Old or new tone placement?

Both are correct; the old style (hòa, thúy) is the most common in practice and is the default. tone_style=new places the mark on the second vowel of oa, oe, uy.

How are names sorted?

By given name first, then middle and family name, using Vietnamese collation, as in school and company lists.

Related APIs

Start with 1,000 free requests every month. Get free API key →