Base64
GET/v0/base64
Validates a Base64 or Base64URL encoded string. Checks character set, padding correctness, and determines the encoding variant. Returns the decoded byte length.
Try it
Example Request
curl -H "Authorization: Bearer YOUR_API_KEY" \ "https://api.isvalid.dev/v0/base64?value=SGVsbG8gV29ybGQ="
Response Fields
| Field | Type | Description |
|---|---|---|
| valid | boolean | Whether the input is valid Base64 |
| variant | string | Encoding variant: standard (uses +/), url-safe (uses -_), or ambiguous (only alphanumeric chars) |
| isPadded | boolean | Whether the input includes = padding |
| decodedLength | number | Length of the decoded data in bytes |
| error | string | Error message when the input is invalid (only present when valid is false) |
Example Response — standard Base64
{
"valid": true,
"variant": "standard",
"isPadded": true,
"decodedLength": 11
}Example Response — URL-safe Base64
{
"valid": true,
"variant": "url-safe",
"isPadded": false,
"decodedLength": 15
}Example Response — invalid
{
"valid": false,
"error": "Invalid Base64 characters"
}