Aller au contenu

Encodeur et Décodeur Base64 et URL UTF-8

Encodez et décodez en toute sécurité textes UTF-8, composants URL et convertissez des fichiers locaux en Data URI sans transfert serveur.

Prêt pour la saisie.

Outil Base64 et URL UTF-8

100% Local

Encodez et décodez en toute sécurité textes UTF-8, composants URL et convertissez des fichiers locaux en Data URI sans transfert serveur.

0 caractères

0 caractères

UTF-8 Base64 & URL Encoding / Decoding Standards

Base64 encoding translates arbitrary binary data and text into an ASCII string format composed of 64 printable characters (A–Z, a–z, 0–9, +, /). It is the standard representation for embedding image assets into CSS/HTML via Data URIs, transmitting authorization headers, and serializing cryptographic signatures across network boundaries.

Why Traditional JavaScript btoa and atob Fail on Multilingual Text

The built-in browser APIs window.btoa and window.atob were specified for Latin-1 single-byte character sequences. Attempting to encode Unicode characters outside of the 0x00–0xFF range (such as Chinese, Japanese, Arabic, accented characters, or emojis) triggers an immediate InvalidCharacterError DOMException or creates corrupt garbage strings.

Our encoder uses the native TextEncoder and TextDecoder web APIs with fail-closed fatal diagnostics, ensuring true byte-level UTF-8 fidelity across all writing systems and complex multi-codepoint emojis (including zero-width joiner sequences).

Standard Base64 vs. URL-Safe Base64 (RFC 4648 § 5)

Standard Base64 uses the plus sign (+) and forward slash (/) characters. When placed in URL query strings or path segments, these characters conflict with URL syntax delimiters. URL-Safe Base64 substitutes hyphen (-) for + and underscore (_) for /, and omits trailing equal signs (=) so the payload can be transmitted in query strings or HTTP headers without double-encoding.

URL Component vs. Complete URL Encoding

  • URL Component Mode (encodeURIComponent): Encodes every reserved punctuation mark (such as ?, &, =, #, /, :) into percent-encoded hexadecimal triplets (e.g. %3F, %26, %3D). This is essential when embedding query parameter values that may themselves contain delimiters.
  • Complete URL Mode (encodeURI): Preserves standard protocol delimiters and query separators (https://, ?, &, =, #), encoding only invalid URL characters like spaces and Unicode codepoints.

RFC 2397 Data URI Scheme and Safe In-Browser File Decoding

The data: URI scheme allows small media assets (such as PNG icons, SVG vectors, or web fonts) to be embedded directly inline within HTML and CSS documents, eliminating additional HTTP round trips. Our tool preflights all files against memory guardrails (up to 20MB) to prevent browser tab crashes, inspects MIME media types and byte sizes, and safely decodes Data URIs back to downloadable byte-identical binary files with sanitized filenames.

Frequently Asked Questions

Comment la prise en charge UTF-8 protège-t-elle les caractères ?
Les méthodes btoa/atob standards ne gèrent que le jeu Latin-1. Notre solution s’appuie sur TextEncoder et TextDecoder pour traiter fidèlement les accents, emojis et alphabets internationaux.
Quelle est la différence entre Composant URL et URL Complète ?
Le mode Composant encode l’ensemble des séparateurs (? et &) pour une utilisation dans une valeur de paramètre. Le mode URL Complète conserve l’architecture de l’adresse.
Mes fichiers sont-ils transmis à un serveur ?
Non. L’ensemble des opérations s’exécute localement dans la mémoire de votre navigateur sans aucun appel réseau.