text string required Unicode text to encode exactly as UTF-8 (1–4,096 characters); surrounding whitespace and a leading BOM are preserved.
Strict RFC 4648 base16, base32, base64 and base64url encoding/decoding with Unicode-safe UTF-8, padding control and malformed-input errors.
Authoritative reference data or standards computation
| Parameter | Type | Default & allowed | Description |
|---|---|---|---|
text
required
| string | allowed: 1 – 4096 example: Hello, København 👋 | Unicode text to encode exactly as UTF-8 (1–4,096 characters); surrounding whitespace and a leading BOM are preserved. |
encoding | enum | default: base64 allowed: base16 | base32 | base64 | base64url example: base64url | RFC 4648 alphabet to use: hexadecimal base16, base32, standard base64, or URL-safe base64url. |
padding | boolean | default: true example: false | Emit trailing '=' padding for base32/base64/base64url. Base16 has no padding. |
text string required Unicode text to encode exactly as UTF-8 (1–4,096 characters); surrounding whitespace and a leading BOM are preserved.
encoding enum RFC 4648 alphabet to use: hexadecimal base16, base32, standard base64, or URL-safe base64url.
padding boolean Emit trailing '=' padding for base32/base64/base64url. Base16 has no padding.
| Parameter | Type | Default & allowed | Description |
|---|---|---|---|
fields | list | example: input,encoding | Return only these fields (comma-separated). Mutually exclusive with 'exclude'. |
exclude | list | example: padded | Return all fields except these (comma-separated). |
pretty | boolean | default: false example: true | Pretty-print the JSON response. |
unwrap | boolean | default: false example: true | Drop the envelope: return the raw array/object without data/meta wrapper. |
fields list Return only these fields (comma-separated). Mutually exclusive with 'exclude'.
exclude list Return all fields except these (comma-separated).
pretty boolean Pretty-print the JSON response.
unwrap boolean Drop the envelope: return the raw array/object without data/meta wrapper.
| Field | Type | Description | Example |
|---|---|---|---|
input | string | Original Unicode text. | Hello |
encoding | string | Selected RFC 4648 encoding. | base64 |
output | string | Encoded bytes in the selected alphabet. | SGVsbG8= |
bytes | integer | Number of UTF-8 input bytes. | 5 |
padded | boolean | Whether output ends in RFC 4648 '=' padding. | true |
input string Original Unicode text.
example: Hello
encoding string Selected RFC 4648 encoding.
example: base64
output string Encoded bytes in the selected alphabet.
example: SGVsbG8=
bytes integer Number of UTF-8 input bytes.
example: 5
padded boolean Whether output ends in RFC 4648 '=' padding.
example: true
/api/base-encodings/encode?text=Hello%2C%20K%C3%B8benhavn%20%F0%9F%91%8B&encoding=base64 {
"data": {
"input": "Hello, København 👋",
"encoding": "base64",
"output": "SGVsbG8sIEvDuGJlbmhhdm4g8J+Riw==",
"bytes": 22,
"padded": true
},
"meta": {
"endpoint": "base-encodings",
"route": "/encode",
"params": {
"text": "Hello, København 👋",
"encoding": "base64",
"padding": true
},
"generatedAt": "2026-07-30T15:14:08.000Z"
}
} /api/base-encodings/encode?text=randomapi.dev&encoding=base64url&padding=false {
"data": {
"input": "randomapi.dev",
"encoding": "base64url",
"output": "cmFuZG9tYXBpLmRldg",
"bytes": 13,
"padded": false
},
"meta": {
"endpoint": "base-encodings",
"route": "/encode",
"params": {
"text": "randomapi.dev",
"encoding": "base64url",
"padding": false
},
"generatedAt": "2026-07-30T15:14:08.000Z"
}
} /api/base-encodings/encode?text=Hello&encoding=base16 {
"data": {
"input": "Hello",
"encoding": "base16",
"output": "48656C6C6F",
"bytes": 5,
"padded": false
},
"meta": {
"endpoint": "base-encodings",
"route": "/encode",
"params": {
"text": "Hello",
"encoding": "base16",
"padding": true
},
"generatedAt": "2026-07-30T15:14:08.000Z",
"warnings": [
"'padding' is not applicable to base16 — hexadecimal encoding never uses '=' padding."
]
}
} | Parameter | Type | Default & allowed | Description |
|---|---|---|---|
value
required
| string | allowed: 1 – 8192 example: SGVsbG8sIEvDuGJlbmhhdm4g8J-Riw== | Encoded value to validate and decode exactly (1–8,192 characters); surrounding whitespace is invalid, not silently trimmed. |
encoding | enum | default: base64 allowed: base16 | base32 | base64 | base64url example: base64url | RFC 4648 alphabet to use: hexadecimal base16, base32, standard base64, or URL-safe base64url. |
output | enum | default: text allowed: text | bytes example: bytes | Return decoded UTF-8 text, or an integer array for arbitrary binary bytes. |
value string required Encoded value to validate and decode exactly (1–8,192 characters); surrounding whitespace is invalid, not silently trimmed.
encoding enum RFC 4648 alphabet to use: hexadecimal base16, base32, standard base64, or URL-safe base64url.
output enum Return decoded UTF-8 text, or an integer array for arbitrary binary bytes.
| Parameter | Type | Default & allowed | Description |
|---|---|---|---|
fields | list | example: input,encoding | Return only these fields (comma-separated). Mutually exclusive with 'exclude'. |
exclude | list | example: padded | Return all fields except these (comma-separated). |
pretty | boolean | default: false example: true | Pretty-print the JSON response. |
unwrap | boolean | default: false example: true | Drop the envelope: return the raw array/object without data/meta wrapper. |
fields list Return only these fields (comma-separated). Mutually exclusive with 'exclude'.
exclude list Return all fields except these (comma-separated).
pretty boolean Pretty-print the JSON response.
unwrap boolean Drop the envelope: return the raw array/object without data/meta wrapper.
| Field | Type | Description | Example |
|---|---|---|---|
input | string | Validated encoded input. | SGVsbG8= |
encoding | string | Selected RFC 4648 encoding. | base64 |
output | string | integer[] | Decoded UTF-8 text or byte array, according to the output parameter. | Hello |
bytes | integer | Number of decoded bytes. | 5 |
validUtf8 | boolean | Whether decoded bytes are well-formed UTF-8. | true |
padded | boolean | Whether the input used trailing '=' padding. | true |
input string Validated encoded input.
example: SGVsbG8=
encoding string Selected RFC 4648 encoding.
example: base64
output string | integer[] Decoded UTF-8 text or byte array, according to the output parameter.
example: Hello
bytes integer Number of decoded bytes.
example: 5
validUtf8 boolean Whether decoded bytes are well-formed UTF-8.
example: true
padded boolean Whether the input used trailing '=' padding.
example: true
/api/base-encodings/decode?value=SGVsbG8sIEvDuGJlbmhhdm4g8J%2BRiw%3D%3D&encoding=base64 {
"data": {
"input": "SGVsbG8sIEvDuGJlbmhhdm4g8J+Riw==",
"encoding": "base64",
"output": "Hello, København 👋",
"bytes": 22,
"validUtf8": true,
"padded": true
},
"meta": {
"endpoint": "base-encodings",
"route": "/decode",
"params": {
"value": "SGVsbG8sIEvDuGJlbmhhdm4g8J+Riw==",
"encoding": "base64",
"output": "text"
},
"generatedAt": "2026-07-30T15:14:08.000Z"
}
} /api/base-encodings/decode?value=JBSWY3DPEBLW64TMMQ&encoding=base32 {
"data": {
"input": "JBSWY3DPEBLW64TMMQ",
"encoding": "base32",
"output": "Hello World",
"bytes": 11,
"validUtf8": true,
"padded": false
},
"meta": {
"endpoint": "base-encodings",
"route": "/decode",
"params": {
"value": "JBSWY3DPEBLW64TMMQ",
"encoding": "base32",
"output": "text"
},
"generatedAt": "2026-07-30T15:14:08.000Z"
}
} /api/base-encodings/decode?value=__79&encoding=base64url&output=bytes {
"data": {
"input": "__79",
"encoding": "base64url",
"output": [
255,
254,
253
],
"bytes": 3,
"validUtf8": false,
"padded": false
},
"meta": {
"endpoint": "base-encodings",
"route": "/decode",
"params": {
"value": "__79",
"encoding": "base64url",
"output": "bytes"
},
"generatedAt": "2026-07-30T15:14:08.000Z"
}
} Encodes Unicode text to bytes with UTF-8 and converts those bytes using the exact RFC 4648 alphabets for base16, base32, base64 or URL-safe base64url. The reverse route validates before it decodes: malformed alphabets, impossible lengths, misplaced padding and non-zero unused bits return a clear 400 rather than being silently repaired.
/encode accepts text and returns the encoded string plus its UTF-8 byte count. padding=true (the default) emits canonical = padding for base32/base64/base64url; base16 never has padding and reports padded=false./decode accepts padded or canonical unpadded input. output=text (default) requires valid UTF-8; use output=bytes for arbitrary binary data, returned as an integer array. validUtf8 tells you whether those bytes form well-formed UTF-8.This is deterministic conversion, not encryption, hashing or secret storage. Inputs are bounded (4,096 text characters or 8,192 encoded characters) so a public Worker cannot be turned into an unbounded transcoder. For randomly generated fake credentials, use the Tokens API instead.
Yes. Text is converted to and from UTF-8 bytes, so emoji and non-Latin scripts round-trip correctly.
Base64 uses + and /; base64url replaces them with URL-safe - and _. Both can be emitted padded or unpadded.
No. It rejects wrong alphabets, impossible lengths, bad padding and non-canonical unused bits with a 400 instead of guessing.
No. Every supported format is a reversible byte encoding and provides no confidentiality or integrity.
Clearly fake API keys, JWTs and hex/base64 secrets — structurally valid enough to exercise parsers and middleware, cryptographically meaningless by design.
Diceware-style random passphrases from a curated 895-word English list — pick word count, separator and capitalization, with an honest entropy estimate.
Random password generator with length, uppercase/digit/symbol toggles, look-alike exclusion, and an honest entropy estimate with a strength rating.
Fake file metadata — kebab-case names, the correct MIME type for every extension, plausible per-kind sizes, unix paths and seeded SHA-256-style checksums.
Diagnose and repair mojibake — the byte round-trip that turned café into café and привет into привет — across 28 legacy encodings.
Decode and encode Google/OSRM encoded polylines at precision 5 or 6 with GeoJSON output, great-circle length, Douglas-Peucker simplify and a decode trace.