encoder · decoder · file · SVG · JWT
Auto

Paste text or upload a file and get the encoded Base64 string, or decode an existing string. With URL-safe mode, whitespace stripping and one-click copy.

Charset
Variant
Wrap every 76 chars
Remove spaces/newlines
Mode
Input
Drop file here
convert
Output
Mode is detected automatically. Paste text → Base64 encode. Paste Base64 → decode. Drag & drop a file to encode it as a data URL.
SVG in CSS: background-image: url("data:image/svg+xml;base64,…") src="data:image/svg+xml;base64,…" or url-encoded (no Base64): data:image/svg+xml,URL-encoded
Fonts in CSS: src: url("data:font/woff2;base64,…") src: url("data:font/woff;base64,…") Image: data:image/png;base64,… data:image/jpeg;base64,… data:image/webp;base64,…
Decode JWT payload (header.payload.signature): Note: signature verification requires the private key.
WordPress REST API — Basic Auth: Authorization: Basic base64(user:pass) ACF encode field value for URL: URL encode URL decode input
MIME email — header charset: Subject: =?UTF-8?B?…?= Line wrap 76 chars (RFC 2045):

Base64 is an encoding scheme that transforms binary data into an ASCII character string: it is used to transmit images inline in CSS (data URIs), encode credentials in HTTP Basic Auth, pass binary data in JSON or XML, and much more in everyday development work.

This tool:

  • Encodes any text to Base64 in standard and URL-safe output (replaces +/ with -_)
  • Decodes valid Base64 strings to readable text
  • Encodes entire files (images, fonts) to data URIs for CSS or HTML embedding
  • Automatically strips spaces, newlines and invalid characters before decoding
  • Validates whether a string is valid Base64 with error indication
  • Operates fully client-side: no data is sent to external servers