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

FieldTypeDescription
validbooleanWhether the input is valid Base64
variantstringEncoding variant: standard (uses +/), url-safe (uses -_), or ambiguous (only alphanumeric chars)
isPaddedbooleanWhether the input includes = padding
decodedLengthnumberLength of the decoded data in bytes
errorstringError 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"
}