Base64 Encoder

Updated: Oct 24, 2017

Base64 Encoder is an online tool to encode binary data or text with control characters for transmission over mediums that cannot handle non printable characters. The encoded text is comprised of only ASCII characters.

Input: Paste plain text below



Settings

Base64 encoding is used to transmit binary data in an ASCII format. Typical usage is to embed image data within scripts such as CSS.

Various programming languages allow you to encode binary data (or even text) using built in APIs. For instance, in C# ToBase64String method of System.Convert class does this. This method takes a byte array as input. Typically this is some sort of binary data that cannot be transferred over the wire without corruption. However, you can also convert text into byte[] and then encode it using base64. You should question why this is needed because it is not the intended use of Base-64 encoding. In this form, you are just wasting bytes to represent your text data.

Checkout the Programming Languages section below for a list of APIs for other languages. Read more at wikipedia

Split Long Lines
When this option is set, lines are wrapped after 75 characters for better viewing. However, the Copy Output button still copies the text as a single line so that it can be used directly with other tools.
Split Long Lines On
TG9yZW0gSXBzdW0gaXMgc2ltcGx5IGR1bW15IHRleHQgb2YgdGhlIHByaW50aW5nIGFuZCB0eX
Blc2V0dGluZyBpbmR1c3RyeS4gTG9yZW0gSXBzdW0gaGFzIGJlZW4gdGhlIGluZHVzdHJ5J3M=
Split Long Lines Off
TG9yZW0gSXBzdW0gaXMgc2ltcGx5IGR1bW15IHRleHQgb2YgdGhlIHByaW50aW5nIGFuZCB0eXBlc2V0dGluZyBpbmR1c3RyeS4gTG9yZW0gSXBzdW0gaGFzIGJlZW4gdGhlIGluZHVzdHJ5J3M=

Example Substitutions

ValueChar
0A
1B
2C
3D
4E
5F
6G
7H
8I
9J
10K
11L
12M
13N
14O
15P
ValueChar
16Q
17R
18S
19T
20U
21V
22W
23X
24Y
25Z
26a
27b
28c
29d
30e
31f
ValueChar
32g
33h
34i
35j
36k
37l
38m
39n
40o
41p
42q
43r
44s
45t
46u
47v
ValueChar
48w
49x
50y
51z
520
531
542
553
564
575
586
597
608
619
62+
63/

How to do Base64 encoding in various programming languages

    • Language: C#
    • Encode: System.Convert.ToBase64String()
    • Decode: System.Convert.FromBase64String()
    • Example: Example
    • Documentation: Documentation
    • Language: VB .NET
    • Encode: System.Convert.ToBase64String()
    • Decode: System.Convert.FromBase64String()
    • Example: Example
    • Documentation: Documentation
    • Language: Java 8+
    • Encode: java.util.Base64.getEncoder().encode()
    • Decode: java.util.Base64.getDecoder().decode()
    • Example: Example
    • Documentation: Documentation
    • Language: Java 7 or less
    • Encode: org.apache.commons.codec.binary.Base64.encodeBase64()
    • Decode: org.apache.commons.codec.binary.Base64.decodeBase64()
    • Example: Example
    • Documentation: Documentation
    • Language: Python
    • Encode: base64.b64encode()
    • Decode: base64.b64decode()
    • Example: Example
    • Documentation: Documentation
    • Language: Ruby
    • Encode: Base64.encode64()
    • Decode: Base64.decode64()
    • Example: Example
    • Documentation: Documentation
 
Created: Aug 20, 2017
Online Tool Designed For: Windows, OS X, Android, iOS, Linux