Text Utilities

Encode/decode text, format JSON, and manipulate URLs quickly and easily.

Understanding Encodings

Base64

Base64 encodes binary data into ASCII text format. Uses 64 printable characters (A-Z, a-z, 0-9, +, /).

Uses:

  • Email attachments
  • Data URIs in HTML
  • API authentication tokens
  • Encoding binary data

URL Encoding

URL encoding (Percent encoding) converts special characters to %HH format where HH is hexadecimal.

Examples:

Space: %20
?: %3F
&: %26
#: %23

JSON Formatting

JSON (JavaScript Object Notation) is a lightweight data format. Formatting makes it human-readable.

Benefits:

  • Easier to debug
  • Validates syntax
  • Improves readability
  • Detects errors

Character Encodings

Different encodings represent characters differently. UTF-8 is the most common for web.

Common encodings:

  • UTF-8 (Unicode)
  • UTF-16 (Unicode)
  • ASCII (7-bit)
  • Hex (hexadecimal)

Real-World Examples

Base64 in HTML Images:

<img src="data:image/png;base64,iVBORw0KGgo...">

Embed images directly in HTML without external files.

HTTP Authentication:

Authorization: Basic base64(username:password)

Encode credentials for HTTP Basic Authentication.

API Query Strings:

/api/search?q=hello%20world&filter=active

URLs must encode spaces and special characters.