Base64 Encode
by @ohernandez-dev-blossom
Encode or decode text using Base64, URL percent-encoding, or HTML entities. Use when the user asks to encode, decode, base64 encode, base64 decode, URL encod...
clawhub install base64-encodeπ About This Skill
name: base64-encode description: Encode or decode text using Base64, URL percent-encoding, or HTML entities. Use when the user asks to encode, decode, base64 encode, base64 decode, URL encode, URL decode, percent-encode, HTML escape, HTML unescape, convert to base64, convert from base64, or escape special characters.
Base64 / URL / HTML Encoder & Decoder
Encode or decode text using Base64, URL percent-encoding, or HTML entities. Processes text client-side with no external calls.
Input
base64 (default), url, or htmlencode (default) or decodeOutput
Instructions
Base64 (type: base64)
Encode:
1. Take the input string.
2. Convert each character to its UTF-8 byte sequence (handle non-ASCII/Unicode correctly).
3. Apply Base64 encoding using the standard alphabet (AβZ, aβz, 0β9, +, /).
4. Pad with = characters to make the length a multiple of 4.
5. The algorithm equivalent is: btoa(unescape(encodeURIComponent(input))).
Decode:
1. Take the Base64-encoded input.
2. Validate it contains only valid Base64 characters (AβZ, aβz, 0β9, +, /, =).
3. Decode using: decodeURIComponent(escape(atob(input))).
4. Return the original UTF-8 string.
URL Percent-Encoding (type: url)
Encode:
1. Apply encodeURIComponent semantics: encode every character except AβZ aβz 0β9 - _ . ! ~ * ' ( ).
2. Spaces become %20 (not +).
3. Non-ASCII characters are UTF-8 encoded then percent-escaped.
Decode:
1. Replace each %XX sequence with the corresponding byte.
2. Interpret the resulting bytes as UTF-8.
3. Equivalent to decodeURIComponent(input).
HTML Entities (type: html)
Encode: Replace these characters with their named HTML entities:
< β <> β >& β &" β "' β 'Decode: Reverse the mapping β replace each HTML entity with its literal character.
Options
type: base64 | url | html β default: base64direction: encode | decode β default: encodeExamples
Base64 encode:
Input: Hello, World!
Output: SGVsbG8sIFdvcmxkIQ==
Base64 encode (Unicode):
Input: HΓ©llo
Output: SMOpbGxv
Base64 decode:
Input: SGVsbG8sIFdvcmxkIQ==
Output: Hello, World!
URL encode:
Input: name=John Doe&city=New York
Output: name%3DJohn%20Doe%26city%3DNew%20York
URL decode:
Input: hello%20world%21
Output: hello world!
HTML encode:
Input:
Output: <script>alert("XSS")</script>
HTML decode:
Input: <h1>Hello & welcome</h1>
Output: Hello & welcome
Error Handling
Error: Invalid Base64 string. Ask the user to verify the input.%XX sequence uses non-hex digits or the sequence is incomplete, report: Error: Invalid URL encoded string.π‘ Examples
Base64 encode:
Input: Hello, World!
Output: SGVsbG8sIFdvcmxkIQ==
Base64 encode (Unicode):
Input: HΓ©llo
Output: SMOpbGxv
Base64 decode:
Input: SGVsbG8sIFdvcmxkIQ==
Output: Hello, World!
URL encode:
Input: name=John Doe&city=New York
Output: name%3DJohn%20Doe%26city%3DNew%20York
URL decode:
Input: hello%20world%21
Output: hello world!
HTML encode:
Input:
Output: <script>alert("XSS")</script>
HTML decode:
Input: <h1>Hello & welcome</h1>
Output: Hello & welcome
βοΈ Configuration
type: base64 | url | html β default: base64direction: encode | decode β default: encode