OnlineNotes Logo

    Base64 Encoder/Decoder

    Encode and decode text payloads with URL-safe and padding controls for API and query workflows.

    Input

    Output

    Ready

    Mode

    Encode

    Input chars

    0

    Output chars

    0

    When to use this tool

    Use Base64 conversion when preparing payloads, storing compact text blobs, or decoding API fields.

    URL-safe mode is helpful for query parameters and path-safe tokens.

    Frequently asked questions

    Can this tool encode and decode UTF-8 text?

    Yes. The tool uses UTF-8 conversions so non-ASCII text is handled correctly when possible.

    What is URL-safe Base64 mode?

    URL-safe mode swaps plus and slash characters for dash and underscore to avoid URL conflicts.

    Can I remove Base64 padding?

    Yes. You can strip trailing padding during encode and restore it automatically during decode.

    Related tools

    Base64 encoder decoder online for UTF-8 payload conversion

    This Base64 encoder decoder online converts text as UTF-8, so accented letters and emoji round-trip correctly, unlike a plain btoa call, which fails on them.

    URL-safe mode and optional padding removal cover query parameters and JWT-style segments. Base64 is an encoding and not encryption: anyone can decode it.

    How it works

    1. Choose Encode or Decode. Switching mode converts the current input at once, so text that is not Base64 will show an error when you switch to Decode.
    2. Encode turns your text into UTF-8 bytes and then into one unbroken Base64 string with no line wrapping. Spaces and newlines in the input are encoded too.
    3. Decode removes all whitespace, adds missing = padding, and reads the bytes as UTF-8. With URL-safe on, it reads - and _ as + and /.
    4. After editing text, press Run conversion. Swap input/output moves the result into the input and flips the mode, which is a quick way to test a round trip.

    Worked example

    Input

    Café >>> ?

    Output

    Standard: Q2Fmw6kgPj4+ID8=
    URL-safe, padding stripped: Q2Fmw6kgPj4-ID8

    The é takes two bytes in UTF-8, so a Latin-1 tool would give a different result. The + becomes - in URL-safe mode, and the final = is removed by "Strip padding on encode". Both strings decode back to the original text when URL-safe is on.

    Edge cases and limits

    • This handles text only. There is no file upload, and no way to download decoded bytes. Decoding binary data does not fail: invalid UTF-8 appears as replacement characters (�), the status still says Success, and the result cannot be turned back into the original bytes.
    • URL-safe input needs URL-safe mode. With the box unchecked, a string containing - or _ gives a browser error, so turn it on when you decode JWT parts. Decoding a JWT this way shows its content but does not verify the signature.
    • A string whose length leaves a remainder of 1 when divided by 4 (such as "abcde") cannot be valid Base64 and fails with an error. The error text comes from the browser.
    • A trailing newline changes the result on encode: "hi" followed by a newline gives aGkK, not aGk=. Input holding only whitespace is treated as empty. Strip padding has no effect in Decode mode.

    When to use it

    • Encode test credentials and metadata for sample requests.
    • Decode Base64 fields returned by APIs and logs.
    • Make URL-safe Base64 for use in a query string.
    • Swap output back into the input to confirm a value round-trips.