How to use the Webhook Base64 File Encoder tool
- Select File and choose any file up to 20 MiB.
- Select Build webhook payload to encode the file.
- Review the JSON in the Result box: filename, contentType and data.
- Select Copy, or use the Download link to save the body as payload.json and send it to your endpoint.
The payload this webhook Base64 file encoder writes
The output is a flat JSON object with three properties. filename is the name of the file you chose, without any folder path. contentType is the media type your browser reports for it, which browsers derive mainly from the file extension. When the browser has no type for the file, the tool writes application/octet-stream. data is the entire file as standard Base64 on one line, with padding.
The sample below is the real output for a 5-byte text file named message.txt that contains Hello.
{
"filename": "message.txt",
"contentType": "text/plain",
"data": "SGVsbG8="
}Testing a webhook receiver with a file
Handlers that accept attachments have several places to fail: body size limits, Base64 decoding, file name handling, type checks and storage. Waiting for a third party to fire a real event for each case is slow. With a payload file you can replay the same request as often as needed.
Save payload.json and post it with curl using --data-binary @payload.json and a Content-Type header of application/json, or load it in your API client. Then vary the input: a PDF, an image, a file with spaces or non-ASCII characters in its name, and a file near your size limit.
Size and limits to keep in mind
The encoder is intentionally small. These points decide whether its output fits your case.
- Input files may be up to 20 MiB. That maximum produces about 28 million Base64 characters.
- Base64 adds one third to the size, so check the result against the body limit of your web server, gateway or serverless platform.
- The file content is not inspected or altered, and any file type is accepted.
- Field names are fixed. Rename them in the output if your receiver expects other keys.
- No signature header, timestamp or event type is generated.
Adapting the JSON to a provider's format
Each service has its own webhook schema, so treat this output as raw material. Common edits are renaming data to content or base64, nesting the object inside an attachments array, and adding an event name or ID. If the real sender signs requests with an HMAC over the body, compute the signature after your edits, because any change to the JSON text, even whitespace, changes the digest.
The matching Webhook Base64 File Decoder reads this exact shape, which gives you a round-trip check before you customize it.
Frequently asked questions
What does the contentType field contain?
The MIME type reported by your browser for the selected file, such as application/pdf or image/png. Browsers map it from the extension and do not read the content. Unknown extensions result in application/octet-stream.
Can I encode several files into one payload?
No. The file field takes one file and the output describes one attachment. Run the tool once per file and combine the objects into an array in your editor.
Is the file uploaded when I build the payload?
No. The browser reads the file locally and the JSON is generated on your device. Nothing is posted to any endpoint until you send the payload yourself.
How do I send the payload to my endpoint?
Use any HTTP client. Set the method to POST, the Content-Type header to application/json and the body to the downloaded file. Reading the body from a file avoids command-line length limits for large attachments.
Why is Base64 used and not multipart upload?
Webhooks are normally a single JSON document, and JSON can only carry text. Base64 keeps the file inside that document at the cost of a third more bytes. Multipart form data is more compact but requires a different parser on the receiver.
Does the encoder keep the folder path of my file?
No. Browsers expose only the base name of a selected file, so filename contains the name and extension without directories.