Base64 ↔ PDF
Encode a PDF to Base64 or decode Base64 back to a PDF — standard or URL-safe, with an optional data-URL prefix — locally in your browser.
- Runs locally in your browser
- No upload required
Capabilities
- Drag and drop
- Local file intake
- Download result
Try it
Supported formats
Privacy
Runs entirely in your browser. Your input is never uploaded, stored, or sent to a third party.
Converted bytes to Base64: 53 byte(s); the result starts with %PDF-.
How it works
- Decode the source bytes with the dependency-free codec.
- Re-encode the result in the standard alphabet.
- Check the decoded bytes for the %PDF- header and report the exact byte length.
- No PDF object parsing is performed; the bytes are copied unchanged.
Methodology
- Encode: read the local PDF bytes and emit Base64 in the standard or URL-safe alphabet, optionally with a data-URL prefix.
- Decode: decode the Base64 with a strict, dependency-free RFC 4648 decoder; malformed input is a named finding.
- Check the decoded bytes for the %PDF- magic and report the exact byte length, never guessing the file type.
Usage
- Choose whether to encode a PDF or decode Base64.
- Pick the alphabet and whether to include a data-URL prefix.
- Run the conversion to copy or download the result.
Examples
These are examples, not current values: they use fixed inputs, while the interactive tool computes live results in your browser.
Encode a minimal PDF to Base64
{
"mode": "encode",
"data": "JVBERi0xLjQKJcOkw7zDtsOfCjEgMCBvYmoKPDwvVHlwZSAvQ2F0YWxvZz4+CmVuZG9iago=",
"alphabet": "standard",
"dataUrlPrefix": false
}Decode Base64 to bytes
{
"mode": "decode",
"data": "JVBERi0xLjQKJcOkw7zDtsOfCjEgMCBvYmoKPDwvVHlwZSAvQ2F0YWxvZz4+CmVuZG9iago=",
"alphabet": "standard",
"dataUrlPrefix": false
}Limitations
A faithful, local conversion
Encoding and decoding use a strict RFC 4648 codec. In encode mode the bytes are copied unchanged; in decode mode a malformed string is reported by name instead of silently dropping characters.
The tool checks the decoded bytes for the %PDF- magic so a non-PDF payload is labelled honestly.
Frequently asked questions
- Is my PDF uploaded?
- No. The bytes are read and converted locally in your browser; nothing is uploaded, stored or logged.
- Which alphabets are supported?
- Standard Base64 and its URL-safe variant (RFC 4648), with an optional `data:application/pdf;base64,` prefix.
Sources
Send feedback
Tell us if this tool helped, report a problem, or suggest a tool. Only the message you type is sent — never the input you used in the tool.
Was this tool useful?
Prefer to write to us directly? See the contact page.