Technical Documentation & FAQ

Base64 URL Encode

  • Section A: The Technical Deep Dive Standard Base64 is not safe for URLs because it includes +, /, and =. These characters are reserved in URI syntax and would be percent-encoded (e.g., + becomes %2B). Base64URL (RFC 4648) solves this by substituting + with - and / with _. Additionally, it omits the trailing padding (=) which can interfere with URL parameter parsing.

  • Section B: Industry Use Cases

    • JWT Construction: Encoding the Header and Payload of a JSON Web Token.

    • URL Slugs: Creating unguessable, safe URL paths for shared resources.

    • OAuth 2.0: Passing state and code_challenge parameters safely between servers.

  • Section C: Handling the Padding In URL-safe encoding, padding is optional and often discouraged. JOTO’s encoder strips the = padding by default, ensuring your output is as compact as possible for HTTP headers and GET parameters.

  • Section D: Developer FAQ

    • Q: Is this the same as base64? A: It uses a different alphabet for the 62nd and 63rd characters.

    • Q: Why is my string shorter? A: Because we remove the trailing = padding characters.