Convert MediaWiki to Base64
Max file size 100mb.
MediaWiki vs Base64 Format Comparison
| Aspect | MediaWiki (Source Format) | Base64 (Target Format) |
|---|---|---|
| Format Overview |
MediaWiki
MediaWiki Markup Language
Wiki markup language created by Magnus Manske and Lee Daniel Crocker for Wikipedia in 2002. Uses distinctive syntax including == headings ==, '''bold''', ''italic'', [[links]], and template transclusion. The standard markup for Wikipedia, Wikimedia projects, and thousands of wiki installations globally. Wiki Standard Text-Based |
Base64
Base64 Binary-to-Text Encoding
Binary-to-text encoding scheme defined in RFC 4648. Represents binary data using 64 printable ASCII characters (A-Z, a-z, 0-9, +, /). Widely used for embedding data in text-based protocols like email (MIME), JSON, XML, and data URIs in HTML and CSS. Data Encoding Transport Safe |
| Technical Specifications |
Type: Wiki markup language
Encoding: UTF-8 MIME Type: text/x-wiki Extensions: .mediawiki, .wiki, .txt Character Set: Full Unicode support Line Endings: LF or CRLF |
Type: Binary-to-text encoding
Encoding: ASCII subset (64 characters) MIME Type: text/plain (encoded content) Extensions: .b64, .base64, .txt Character Set: A-Z, a-z, 0-9, +, /, = (padding) Standard: RFC 4648, RFC 2045 |
| Syntax Examples |
MediaWiki readable markup: == Hello World ==
'''Bold text''' and
''italic text'' with a
[[wiki link]] here.
{{Template|key=value}}
|
Base64 encoded output: PT0gSGVsbG8gV29ybGQg PT0KJycnQm9sZCB0ZXh0 JycnIGFuZAonJ2l0YWxp YyB0ZXh0Jycgd2l0aCBh CltbV2lraSBsaW5rXV0g aGVyZS4= |
| Content Support |
|
|
| Advantages |
|
|
| Disadvantages |
|
|
| Common Uses |
|
|
| Best For |
|
|
| Version History |
Introduced: 2002 (for Wikipedia)
Creators: Magnus Manske, Lee Daniel Crocker Status: Actively maintained Evolution: Parsoid, VisualEditor, Lua |
Introduced: 1987 (RFC 989 for PEM)
Current Standard: RFC 4648 (2006) Status: Stable internet standard Evolution: PEM to MIME to RFC 4648 |
| Software Support |
MediaWiki: Native parser
Pandoc: Full read/write Editors: VisualEditor, WikiEditor Other: Parsoid, various converters |
Languages: Built-in in all major languages
CLI Tools: base64 (Unix), certutil (Windows) Browsers: btoa()/atob() JavaScript functions Other: OpenSSL, online encoders |
Why Convert MediaWiki to Base64?
Converting MediaWiki markup to Base64 encoding is essential when you need to safely transmit or embed wiki content through channels that may not handle special characters properly. MediaWiki markup contains numerous characters like curly braces, square brackets, pipe symbols, and equals signs that can interfere with JSON, XML, URL parameters, and other data transport formats. Base64 encoding eliminates these conflicts by representing the content using only safe ASCII characters.
MediaWiki's rich syntax -- including == headings ==, '''bold''' markers, ''italic'' delimiters, [[wiki links]], and template calls -- contains characters that are meaningful in many programming and data exchange contexts. For example, curly braces conflict with JSON and many template engines, square brackets conflict with array notation, and pipe characters are used as delimiters in CSV and command-line tools. Base64 encoding wraps all of this content into a safe, transport-friendly string.
Base64 is the standard encoding for transmitting binary and text data through text-only channels. Defined in RFC 4648, it uses 64 printable ASCII characters (A-Z, a-z, 0-9, +, /) to represent data. Every 3 bytes of input produce 4 characters of output, resulting in approximately 33% size increase. The encoded content preserves the exact byte-for-byte content of the original MediaWiki markup and can be decoded back perfectly.
Common use cases include embedding wiki content in API payloads, storing MediaWiki markup in database text fields that may have character restrictions, transmitting wiki content through email systems, or including wiki markup in configuration files. Base64-encoded wiki content can also be used in data URIs for embedding content directly in HTML pages or passing through URL parameters without URL-encoding issues.
Key Benefits of Converting MediaWiki to Base64:
- Transport Safety: Eliminate special character conflicts in JSON, XML, and URLs
- Data Integrity: Preserve exact MediaWiki markup without any character corruption
- Universal Support: Base64 decoding is built into every programming language
- API Compatible: Safely include wiki content in REST API request and response bodies
- Storage Friendly: Store wiki markup in any text field without escaping issues
- Email Safe: Transmit wiki content as MIME-encoded email attachments
- Reversible: Perfectly decode back to original MediaWiki markup at any time
Practical Examples
Example 1: Wiki Content for API Transport
Input MediaWiki file (article.mediawiki):
== Introduction ==
'''MediaWiki''' is a free and open-source
wiki engine written in [[PHP]].
{{Infobox|name=MediaWiki|type=Wiki}}
Output Base64 file (article.base64):
PT0gSW50cm9kdWN0aW9uID09CicnJ01lZGlhV2lraScn
JyBpcyBhIGZyZWUgYW5kIG9wZW4tc291cmNlCndpa2kg
ZW5naW5lIHdyaXR0ZW4gaW4gW1tQSFBdXS4KCnt7SW5m
b2JveHxuYW1lPU1lZGlhV2lraXx0eXBlPVdpa2l9fQ==
Safe for JSON: {"content": "PT0gSW50cm9..."}
Safe for XML: <content>PT0gSW50cm9...</content>
Safe for URLs: ?data=PT0gSW50cm9...
Example 2: Embedding Wiki Content in HTML Data URI
Input MediaWiki file (snippet.mediawiki):
'''Hello World''' This is a [[simple]] wiki page. * Item one * Item two
Output Base64 file (snippet.base64):
JycnSGVsbG8gV29ybGQnJycKClRoaXMgaXMgYSBb W3NpbXBsZV1dIHdpa2kgcGFnZS4KKiBJdGVtIG9u ZQoqIEl0ZW0gdHdv Can be used in data URI: data:text/plain;base64,JycnSGVsbG8gV29ybGQn... Embeddable directly in HTML or JavaScript without escaping brackets or apostrophes
Example 3: Wiki Markup Storage in Database
Input MediaWiki file (table_page.mediawiki):
{| class="wikitable"
|-
! Name !! Value
|-
| Key's "data" || {{Value|test}}
|-
| Special || a & b
|}
Output Base64 file (table_page.base64):
e3wgY2xhc3M9Indpa2l0YWJsZSIKfC0KISBOYW1l ICEhIFZhbHVlCnwtCnwgS2V5J3MgImRhdGEiIHx8 IHt7VmFsdWV8dGVzdH19CnwtCnwgU3BlY2lhbCA8 Y2hhcnM+IHx8IGEgJiBiCnx9 All problematic characters safely encoded: + Curly braces from templates + Pipe symbols | from tables + Quotes ' " from content + Angle brackets < > from HTML + Ampersands & from entities
Frequently Asked Questions (FAQ)
Q: What is Base64 encoding?
A: Base64 is a binary-to-text encoding scheme that represents data using 64 printable ASCII characters (A-Z, a-z, 0-9, +, /). It is defined in RFC 4648 and is used to safely transmit data through text-only channels. Every 3 bytes of input produce 4 Base64 characters, with = padding at the end if needed. Base64 is universally supported across all programming languages and platforms.
Q: Why would I need to Base64-encode wiki markup?
A: MediaWiki markup contains characters that can cause problems in many contexts. Curly braces conflict with JSON and template engines, square brackets conflict with array syntax, pipe characters conflict with CSV delimiters, and apostrophes conflict with string literals. Base64 encoding wraps all of these into safe ASCII characters that pass through any text channel without modification.
Q: How much larger is the Base64-encoded output?
A: Base64 encoding increases file size by approximately 33%. Every 3 bytes of input become 4 bytes of output (a 4:3 ratio). A 100 KB MediaWiki file will produce approximately 133 KB of Base64 output. Line wrapping (optional, typically at 76 characters per RFC 2045) adds a small additional overhead from newline characters.
Q: Can I decode the Base64 back to the original MediaWiki markup?
A: Yes, Base64 encoding is completely reversible. The decoded output will be identical byte-for-byte to the original MediaWiki markup file. You can decode using command-line tools (base64 -d on Unix), programming language built-in functions (Python's base64 module, JavaScript's atob()), or any online Base64 decoder.
Q: Is Base64 encryption?
A: No, Base64 is encoding, not encryption. It provides no security whatsoever -- anyone can decode Base64 content instantly. It is designed purely for data transport compatibility, not confidentiality. If you need to secure your MediaWiki content, use proper encryption (AES, RSA) before or after Base64 encoding. Never rely on Base64 for any security purpose.
Q: What is the difference between standard Base64 and URL-safe Base64?
A: Standard Base64 uses + and / characters, which have special meaning in URLs. URL-safe Base64 (also defined in RFC 4648) replaces + with - and / with _, making it safe for use in URLs, file names, and identifiers without additional URL-encoding. Our converter produces standard Base64 by default, which is compatible with the widest range of systems.
Q: Can I use Base64-encoded MediaWiki content in a JSON API?
A: Yes, this is one of the primary use cases. MediaWiki markup with its braces, brackets, and quotes can break JSON strings. Base64-encoded content is a plain alphanumeric string that fits safely in any JSON string value. The receiving system simply decodes the Base64 to recover the original wiki markup. This is a common pattern in APIs that handle wiki content.
Q: Does Base64 encoding preserve Unicode characters in MediaWiki?
A: Yes, Base64 operates on raw bytes, so UTF-8 encoded Unicode characters in MediaWiki markup are preserved perfectly. The encoding process treats the file as a byte stream regardless of content. When decoded, all Unicode characters (including CJK, Cyrillic, Arabic, emoji, and special symbols) are recovered exactly as they were in the original file.