Encode / Decode API

Encode or decode text as Base64, Base64URL, hex, URL encoding, HTML entities, Unicode escapes, ROT13 or binary with one simple API call.

GETPOSThttps://apibox.io.vn/v1/encode
Security & Crypto▶ Try it online

The Encode API converts text to and from the encodings developers deal with every day. Choose a scheme – base64, base64url, hex, url, html, unicode, rot13 or binary – and an action (encode, the default, or decode). Everything is UTF-8 aware, so Vietnamese, emoji and other non-ASCII text survive a round trip through Base64 or hex.

Details per scheme: base64url encodes without padding (JWT style); hex decoding ignores spaces and a 0x prefix; url uses percent-encoding (and turns + into spaces when decoding); html escapes & < > " ' and decodes named and numeric entities; unicode turns non-ASCII characters into \uXXXX escapes; binary outputs 8-bit groups separated by spaces.

Send text in the query string or a JSON body, or post the text as a raw text/plain body. The result comes back in a small JSON object together with the scheme and action used. Invalid input for a decode (for example broken Base64) returns a clear decode_error.

Parameters

NameInTypeRequiredDefault
textbody|querystringyesText to encode or decode (or send it as a raw text/plain body).
schemebody|querystringnobase64base64, base64url, hex, url, html, unicode, rot13 or binary.
actionbody|querystringnoencodeencode or decode.

Example

curl -X POST "https://apibox.io.vn/v1/encode" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text":"Xin chào APIBox","scheme":"base64"}'

Response

{
  "scheme": "base64",
  "action": "encode",
  "result": "WGluIGNow6BvIEFQSUJveA=="
}

Use cases

  • Decode Base64 payloads from logs, e-mails or API responses
  • URL-encode query parameters before building links
  • Escape user content as HTML entities before rendering
  • Inspect the raw bytes of a string as hex or binary

FAQ

What is the difference between Base64 and Base64URL?

Base64URL replaces + and / with - and _ and drops the = padding so the result is safe in URLs and JWTs. Decoding with either scheme accepts both alphabets.

Does it handle Vietnamese and emoji?

Yes. Text is converted to UTF-8 bytes before encoding and decoded back from UTF-8, so "Xin chào" becomes "WGluIGNow6Bv" in Base64 and decodes back unchanged.

Is this encryption?

No. Base64, hex, URL encoding and ROT13 are reversible encodings that anyone can decode. To protect data use real encryption; to fingerprint it use /v1/hash.

Related APIs

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