Codifica
Base64
Codifica e decodifica Base64 — testo e file, direttamente nel browser.
Base64 is a binary-to-text encoding that represents arbitrary bytes using 64 printable ASCII characters (A–Z, a–z, 0–9, plus + and /). It exists so binary data — images, archives, cryptographic keys — can pass unchanged through channels that were designed for text only.
This tool encodes and decodes both plain text and files. Everything runs client-side in your browser: the input never leaves your machine, which makes it safe for tokens, private keys, and other sensitive data.
How to use it
- Encode text: pick the Encode / Text mode, paste your string, and copy the Base64 result.
- Encode a file: switch to File mode and choose a file — you get its Base64 representation, ready for a data URI or JSON field.
- Decode: switch to Decode mode and paste a Base64 string; if it decodes to a known file type you can download the original file.
Common uses
- Embedding small images or fonts directly in CSS/HTML via data: URIs.
- Putting binary payloads inside JSON, XML, or form fields.
- Encoding credentials for the HTTP Basic Authorization header.
- Storing or transmitting PEM keys and certificates.
Things to keep in mind
Base64 is not encryption — anyone can decode it. It only changes the representation of data, not its confidentiality.
Encoded output is about 33% larger than the input because every 3 bytes become 4 characters.
For URLs and file names use Base64URL, which swaps + and / for - and _ and often drops the = padding.
Articolo su questo strumento: Base64: a cosa serve la codifica e come funziona
Domande frequenti
A cosa serve realmente Base64?
Base64 trasforma dati binari in testo ASCII semplice così può viaggiare in sicurezza attraverso sistemi che gestiscono solo testo, come corpi di email, payload JSON o una piccola immagine incorporata direttamente in CSS/HTML.
Perché l'output codificato è più grande del mio input?
Base64 impacchetta 3 byte di input in 4 caratteri di output, quindi il testo codificato è circa il 33% più grande dell'originale. È normale, non un errore.
Il mio file o testo viene caricato da qualche parte?
No. La codifica e decodifica avvengono interamente nel tuo browser con JavaScript — nulla viene inviato a un server, quindi funziona anche offline.
In cosa differisce il Base64 standard dal Base64URL?
Nel Base64URL i caratteri + e / sono sostituiti da - e _, così la stringa può essere inserita in sicurezza in un URL o in un nome di file senza un ulteriore percent-encoding. È proprio questa la variante usata da JWT.
Cosa significa il carattere = alla fine della stringa?
È un carattere di riempimento (padding) che indica quanti byte mancano nell'ultimo blocco da 3 byte. Non è sempre obbligatorio — alcuni sistemi lo omettono deliberatamente.