Convert ADOC to Base64
Max file size 100mb.
ADOC vs Base64 Format Comparison
| Aspect | ADOC (Source Format) | Base64 (Target Encoding) |
|---|---|---|
| Format Overview |
ADOC
AsciiDoc Markup Language
AsciiDoc is a lightweight markup language for writing technical documentation, articles, books, and web pages. It uses plain text with intuitive formatting conventions that can be converted to HTML, PDF, EPUB, and other formats. Popular for documentation projects like Asciidoctor and Spring Framework docs. Documentation Plain Text |
Base64
Binary-to-Text Encoding Scheme
Base64 is a binary-to-text encoding scheme that represents binary data using 64 ASCII characters (A-Z, a-z, 0-9, +, /). It converts any data into a safe ASCII string format, commonly used in email attachments, data URLs, APIs, and when binary data needs to be transmitted over text-based protocols. Text Encoding ASCII Safe |
| Technical Specifications |
Structure: Plain text with markup syntax
Encoding: UTF-8 text Format: Human-readable markup Compression: None (plain text) Extensions: .adoc, .asciidoc, .asc |
Structure: Continuous ASCII string
Encoding: 64-character alphabet Format: 6-bit groups to 8-bit bytes Overhead: ~33% size increase Extensions: .b64, .base64, .txt |
| Syntax Examples |
AsciiDoc uses intuitive markup: = Document Title
Author Name
== Section Heading
This is *bold* and _italic_.
* List item one
* List item two
[source,python]
----
print("Hello")
----
|
Base64 output (ASCII characters): PSBEb2N1bWVudCBUaXRsZQpB dXRob3IgTmFtZQoKPT0gU2Vj dGlvbiBIZWFkaW5nCgpUaGlz IGlzICpib2xkKiBhbmQgX2l0 YWxpY18uCgoqIExpc3QgaXRl bSBvbmUKKiBMaXN0IGl0ZW0g dHdvCg== |
| Content Support |
|
|
| Advantages |
|
|
| Disadvantages |
|
|
| Common Uses |
|
|
| Best For |
|
|
| Version History |
Introduced: 2002 (Stuart Rackham)
Current Version: Asciidoctor 2.x Status: Active development Evolution: Asciidoctor superseded original |
Introduced: 1987 (Privacy Enhanced Mail)
Standardized: RFC 4648 (2006) Status: Stable standard Evolution: URL-safe variants added |
| Software Support |
Asciidoctor: Primary processor (Ruby/JS)
IDE Support: VS Code, IntelliJ, Atom Static Sites: Antora, Jekyll, Hugo Other: GitHub, GitLab rendering |
All Languages: Built-in support
Browsers: btoa()/atob() functions Command Line: base64 command (Unix) Other: Universal library support |
Why Convert ADOC to Base64?
Converting AsciiDoc documents to Base64 encoding is essential when you need to transmit documentation content through channels that only support ASCII text, such as JSON APIs, XML documents, email systems, or database text fields. Base64 encoding ensures that your ADOC content, including any special characters or Unicode text, is safely preserved during transmission.
AsciiDoc files often contain special characters like asterisks (*), underscores (_), brackets ([]), and various Unicode characters for technical documentation. When embedding these files in API payloads, configuration files, or database records, Base64 encoding prevents parsing errors and character corruption that could occur with raw text transmission.
Base64 is particularly useful for documentation automation workflows. Development teams can encode ADOC documentation files for inclusion in CI/CD pipelines, automated deployment scripts, or configuration management systems. The encoded content can be safely stored in JSON configuration files, environment variables, or transmitted through RESTful APIs.
While Base64 encoding increases file size by approximately 33%, it provides a reliable way to handle documentation content in text-only environments. The encoded output consists only of letters (A-Z, a-z), numbers (0-9), plus (+), slash (/), and equals (=) for padding, making it compatible with virtually any text-based system.
Key Benefits of Converting ADOC to Base64:
- Safe Transmission: Preserves all special characters and markup syntax
- API Compatible: Embed documentation in JSON/XML payloads
- Database Storage: Store ADOC content in text/VARCHAR fields
- Email Friendly: Attach documentation via MIME encoding
- Configuration Files: Include docs in YAML/JSON configs
- Version Control: Safe for automated commit messages
- Reversible: Decode back to original ADOC anytime
Practical Examples
Example 1: API Documentation Embedding
Input ADOC file (api-docs.adoc):
= API Reference
:toc:
== Authentication
Use the `/auth` endpoint with your API key:
[source,bash]
----
curl -H "Authorization: Bearer YOUR_KEY" \
https://api.example.com/v1/data
----
NOTE: API keys expire after 30 days.
Output Base64 encoded:
PSBBUEkgUmVmZXJlbmNlCjp0b2M6Cgo9PSBBX XRoZW50aWNhdGlvbgoKVXNlIHRoZSBgL2F1dG hgIGVuZHBvaW50IHdpdGggeW91ciBBUEkga2V5 OgoKW3NvdXJjZSxiYXNoXQotLS0tCmN1cmwgLU ggIkF1dGhvcml6YXRpb246IEJlYXJlciBZT1VS X0tFWSIgXAogICAgIGh0dHBzOi8vYXBpLmV4YW 1wbGUuY29tL3YxL2RhdGEKLS0tLQoKTk9URTog QVBJIGtleXMgZXhwaXJlIGFmdGVyIDMwIGRheX Mu
Example 2: Configuration File Storage
Input ADOC file (readme.adoc):
= Project Setup == Requirements * Python 3.8+ * Docker * PostgreSQL == Installation . Clone the repository . Run `docker-compose up` . Access http://localhost:8000
Usage in JSON config:
{
"project": "myapp",
"documentation": "PSBQcm9qZWN0IFNldHVwCgo9PSBSZXF1aXJl
bWVudHMKCiogUHl0aG9uIDMuOCsKKiBEb2NrZX
IKKiBQb3N0Z3JlU1FMCgo9PSBJbnN0YWxsYXRp
b24KCi4gQ2xvbmUgdGhlIHJlcG9zaXRvcnkKLi
BSdW4gYGRvY2tlci1jb21wb3NlIHVwYAouIEFj
Y2VzcyBodHRwOi8vbG9jYWxob3N0OjgwMDA=",
"encoding": "base64"
}
Example 3: Email Attachment
Input ADOC file (report.adoc):
= Weekly Status Report John Smith2024-01-15 == Summary Project is *on track* for Q1 release. |=== |Task |Status |Owner |Backend API |Complete |Alice |Frontend UI |In Progress |Bob |===
MIME-encoded for email:
Content-Type: text/plain; name="report.adoc" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="report.adoc" PSBXZWVrbHkgU3RhdHVzIFJlcG9ydApKb2huIF NtaXRoIDxqb2huQGNvbXBhbnkuY29tPgoyMDI0 LTAxLTE1Cgo9PSBTdW1tYXJ5CgpQcm9qZWN0IG lzICpvbiB0cmFjayogZm9yIFExIHJlbGVhc2Uu Cg==
Frequently Asked Questions (FAQ)
Q: What is Base64 encoding?
A: Base64 is a binary-to-text encoding scheme that converts any data into a string of ASCII characters. It uses 64 characters (A-Z, a-z, 0-9, +, /) plus "=" for padding. It's commonly used when binary data needs to be transmitted over text-based protocols like email, JSON, or XML.
Q: Why does Base64 increase file size?
A: Base64 encoding converts every 3 bytes of input into 4 ASCII characters, resulting in approximately 33% larger output. This overhead is the trade-off for being able to safely transmit any data through text-only channels. For a 100KB ADOC file, the Base64 output will be about 133KB.
Q: Can I decode Base64 back to the original ADOC file?
A: Yes! Base64 encoding is completely reversible. You can decode the Base64 string back to the exact original ADOC content using any Base64 decoder. The encoding preserves all characters, formatting, and structure of your original AsciiDoc document perfectly.
Q: Is Base64 encoding the same as encryption?
A: No, Base64 is NOT encryption. It's simply an encoding scheme that converts data to a different representation. Anyone can decode Base64 without any key or password. If you need security, encrypt your ADOC file first, then Base64 encode the encrypted data.
Q: When should I use Base64 for ADOC files?
A: Use Base64 when embedding ADOC content in JSON/XML APIs, storing in database text fields, sending via email, including in configuration files, or transmitting through any text-only protocol. If you're just storing or sharing the file normally, Base64 encoding isn't necessary.
Q: Will AsciiDoc formatting be preserved after encoding?
A: Absolutely! Base64 encoding preserves every single byte of your original file, including all AsciiDoc markup syntax, special characters, whitespace, and line breaks. When decoded, the ADOC file will be identical to the original and can be processed normally by Asciidoctor.
Q: What's the difference between standard Base64 and URL-safe Base64?
A: Standard Base64 uses "+" and "/" characters, which have special meanings in URLs. URL-safe Base64 (Base64URL) replaces these with "-" and "_" respectively, making it safe for use in URLs and filenames. Our converter uses standard Base64 (RFC 4648).
Q: Can I Base64 encode large ADOC documentation files?
A: Yes, you can encode ADOC files of any size. However, remember the 33% size increase and potential memory limitations of the receiving system. For very large documentation projects, consider encoding individual files rather than entire documentation sets, or use compression before encoding.