How to use the AI API Base64 Extractor tool
- Paste the complete JSON response into the API response JSON box, or select Example to load a small b64_json sample.
- Select Extract payloads to scan the document.
- Read the Result box: one entry per payload with its path, decodedBytes and base64 value.
- Select Copy for the report text, or use the Download link to save it as base64-values.json.
How the extractor finds Base64 in a JSON response
The tool parses your input with the browser's JSON parser and then walks every object and array in document order. A string becomes a candidate in two cases: its key has one of the names listed below, compared without regard to letter case, or the string itself starts with a data URL header such as data:image/png;base64, whatever its key is called.
Each candidate then goes through a strict Base64 decoder. Values that fail are skipped without an error, so ordinary text under a key such as content does not stop the run. Values that pass are reported in the order they appear.
- b64_json, the field image generation APIs use for inline images.
- audioContent, the field text-to-speech responses use.
- data, base64, b64 and bytes, common in audio objects and inline file parts.
- image, image_url and file, when the value is itself a Base64 string.
- content and payload, which cover generic attachment objects.
A worked example with paths and sizes
The Example button loads a response shaped like an image generation result. The report gives each location as a bracketed path that starts at $ for the document root. Array positions are written as quoted numbers, so the first element of data is ["0"]. decodedBytes is the size after decoding, here the 5 bytes of the word Hello.
The base64 value in the report is encoded again from the decoded bytes, so a data URL header is removed, URL-safe characters become + and /, and missing padding is restored. Paste that value into Base64 to File to get the content itself.
{
"data": [
{
"b64_json": "SGVsbG8="
}
]
}
Report:
[
{
"path": "$[\"data\"][\"0\"][\"b64_json\"]",
"decodedBytes": 5,
"base64": "SGVsbG8="
}
]Limits and values the scan will not report
The scan goes by key names, which keeps it predictable and has consequences worth knowing.
- A Base64 string under any other key, for example delta or result, is ignored unless it is a data URL.
- Strings inside an array are matched by their index, not by the array's key, so {"data": ["SGVsbG8="]} reports nothing.
- Short plain text that happens to be valid Base64, such as the word stop under content, is listed as a 3-byte payload.
- More than 100 payloads ends the run with a request to choose a smaller payload.
- Documents with more than 100,000 values are rejected with Choose a smaller JSON document.
Where this helps when debugging AI backends
Responses that carry generated images or speech can be several megabytes of one-line JSON, which is painful to read in a terminal or a log viewer. This tool tells you how many payloads came back, where each one sits and how large it is after decoding.
Frequently asked questions
Is my API response sent to a server?
No. The JSON is parsed and scanned by JavaScript on this page. Responses that contain generated images, audio or user data stay on your device, and the report file is created locally as well.
Why does the tool say No Base64 payloads were found?
Either the Base64 sits under a key the scanner does not recognize, it is an element of a plain string array, or the value is not valid Base64.
Does it extract Base64 from streaming responses?
Not directly. This page expects one complete JSON document. For a stream captured as server-sent events or newline-delimited JSON, use the SSE / NDJSON Base64 Extractor, which parses each record separately and applies the same field rules.
Why is the JSON rejected with a syntax error?
The input must be strict JSON. Trailing commas, single quotes, comments, a log prefix before the opening brace or a response cut off in the middle of a string all stop the parser.