Automation & Workflows – Jul 15, 2026 – 5 min read
n8n Convert to File Node: Complete Base64, PDF & Document Workflow Guide

n8n Convert to File Node: Complete Base64, PDF & Document Workflow Guide
TL;DR: - The n8n Convert to File node turns JSON arrays, raw strings, HTML, and Base64-encoded data into real binary files — CSV, XLSX, plain text, and more — with no code. - It has zero native PDF capability: generating or converting PDFs always requires an HTTP Request node calling an external file conversion API. - Rate limits are the #1 silent killer of n8n file workflows in production — CloudConvert's free tier caps at 25 conversions per day, which an overnight batch run burns in minutes. - A free, cap-free API like Convertfleet handles 177+ formats and drops into n8n in under five minutes, removing the rate-limit problem entirely. - Base64 encoding inflates file size by ~33% — plan storage and bandwidth accordingly when processing high volumes.
You're building an n8n automation — report generation, invoice export, document processing — and somewhere in that workflow you hit the wall: how do I turn this data into an actual file I can send, store, or download? The n8n convert to file node handles most of it natively. What catches people off guard is exactly where it stops working, and what you have to bolt on to close the gap.
This guide is written for n8n builders who already know the basics and are running into real production problems: Base64-encoded API responses that won't save correctly, PDFs that need converting to DOCX, or rate-limited third-party services blowing up overnight automation runs. Each section opens with a direct answer, then goes deep with specific settings, node configs, and the failure modes nobody documents.
n8n has grown to over 85,000 GitHub stars as of 2026, with more than 50,000 registered members on the n8n community forum — and file conversion questions are consistently among the most-asked topics. This is the guide those threads keep pointing back to.
What Is the n8n Convert to File Node — and What Can't It Do?
The Convert to File node takes structured or binary data inside an n8n workflow and outputs a downloadable binary file object — a proper file item that downstream nodes can email, upload to S3, write to disk, or pass forward in the pipeline.
Supported output formats natively:
| Format | Input Required | Common Use Case |
|---|---|---|
| CSV | JSON array of objects | Exporting database query results |
| XLSX / ODS | JSON array of objects | Spreadsheet reports with formatting |
| HTML | HTML string | Email templates, web page archives |
| ICS | Event object | Calendar invites |
| RTF | Rich text string | Basic formatted documents |
| Plain text (.txt) | Any string | Log exports, flat file generation |
| Base64 decode | Base64-encoded string | Converting API responses to usable files |
What it cannot do natively:
- Generate a PDF from HTML, JSON, or any other format
- Convert PDF → DOCX, DOCX → PDF, PDF → image, PDF → TIFF
- Apply OCR to scanned documents
- Compress, merge, split, or watermark PDFs
- Handle any complex cross-format document transformation
For all of those tasks, the pattern is always the same: an HTTP Request node calling an external file conversion API, followed by handling the binary or Base64 response. The comparison table later in this guide covers which API to use when.
Who this is NOT for: If you need real-time PDF generation at scale (thousands per hour) with sub-second latency, n8n's HTTP Request overhead plus API round-trip time will bottleneck. Use a dedicated service with direct API integration instead.
How to Use the n8n Convert to File Node: Step-by-Step
Setting up the node takes under three minutes for simple cases. The most common workflow is converting a JSON array of records to a CSV file — here's the exact configuration.
-
Add a "Set" node to define your data. Create a field containing a JSON array:
[{"name": "Alice", "score": 92}, {"name": "Bob", "score": 87}]. Each object becomes a CSV row; each key becomes a column header. -
Add the "Convert to File" node — search for it in the node panel under the Core category (n8n v1.x). Connect it to your Set node.
-
Set "Operation" to "CSV". The node maps JSON keys to column headers automatically. No manual column configuration needed.
-
Set "Put Output File in Field" to a name like
data. This is the binary field name downstream nodes will reference — keep it consistent across your workflow. -
Set "File Name" to something meaningful, like
report-{{ $now.format("yyyy-MM-dd") }}.csv. Dynamic filenames prevent overwrites in storage destinations. -
Connect to a delivery node — "Write Binary File" for self-hosted instances, or "Gmail", "Google Drive", "S3", or "Slack" to deliver the file.
-
Test by clicking "Execute Node" on the Convert to File node. The output panel should show a binary item with MIME type
text/csvand the correct filename.
Critical: The multi-item trap. If your upstream node outputs multiple items (say, 200 rows from a Postgres query), the CSV operation processes each item separately by default — giving you 200 single-row files. To get one combined file, add an "Aggregate" node before Convert to File. Set "Aggregate" to "All Items into a Single List", then pass that to CSV. This is the #1 structural mistake in n8n file export workflows.
For Base64 input, change Operation to "Move Base64 String to File". Point "Base64 Input Field Name" at the field containing your Base64 string, set the MIME type explicitly (application/pdf, image/png, etc.), and set a filename with the correct extension. The node decodes the Base64 and outputs a proper binary item.
n8n Convert File to Base64: The Complete Workflow
Base64 is how many APIs return files: not as a direct binary download, but as a text string embedded in a JSON response body. The Convert to File node decodes that string back into a real binary file — but the workflow direction matters.
Base64 encoding inflates file size by roughly 33% (a 1 MB PDF becomes approximately 1.37 MB as a string) — fine for occasional files, but worth noting when you're processing high volumes. Here are both directions:
Receiving a Base64-encoded file from an API (decode):
- HTTP Request node — call the API. The JSON response contains something like
"document": "JVBERi0xLjQK...". - Set node — isolate just the Base64 string:
{{ $json.document }}. - Convert to File node — Operation: "Move Base64 String to File". Set "Base64 Input Field Name" to your field. Set "MIME Type" to
application/pdf(or whatever the file type is). Set "File Name" toinvoice-{{ $json.id }}.pdf. - The output is a binary file item your workflow can store, email, or process further.
Sending a file as Base64 to an API (encode):
Use the "Extract from File" node — not Convert to File. Set Operation to "Convert to Base64 String". Pass the resulting Base64 string as a JSON field in your HTTP Request node's body.
The two nodes are complementary: Convert to File decodes Base64 to binary; Extract from File encodes binary to Base64. Most confusion in the n8n community comes from confusing which direction is which. If you're sending a file to an API: Extract from File first. If you're receiving one: Convert to File after.
Pro tip from testing: Some APIs return Base64 with a data:application/pdf;base64, prefix. The Convert to File node chokes on this — strip the prefix first with a Set node using {{ $json.document.replace(/^data:.*?;base64,/, '') }}.
Converting PDFs Inside n8n Without Hitting Rate Limits
The native Convert to File node has zero PDF capability. Every PDF operation in n8n — generation, conversion, compression, or rendering — requires an HTTP Request to an external API. The only question is which one, and whether it will still be running when your overnight batch hits 3 AM.
Most builders reach for CloudConvert first. It works reliably, but the free tier limits users to 25 conversion credits per day — a cap that any production workflow burns through fast. Paid plans start at around $13/month for 250 conversions, which scales poorly once you're processing hundreds of documents per run.
The rate-limit failure is particularly insidious because it doesn't error immediately: your workflow will process the first 25 items successfully, then fail silently on item 26 unless you have error handling configured. Teams typically discover this a week into production when a client reports missing files.
The fix has two parts: pick an API without hard daily caps, and add proper error handling to your loop regardless.
n8n workflow — HTML to PDF via external API:
| Step | Node | Key Settings |
|---|---|---|
| 1 | HTTP Request (data source) | Fetch or build HTML content |
| 2 | HTTP Request (API call) | POST to conversion API; Body: JSON with HTML string + options |
| 3 | IF node | Check response.status === 200; route failures to error handler |
| 4 | Convert to File | If API returns Base64: decode. If binary stream: skip this node |
| 5 | Delivery node | S3, Google Drive, email, or webhook |
Convertfleet's file conversion API returns either Base64 or binary stream depending on the endpoint, supports Chromium-based HTML rendering (meaning modern CSS, Google Fonts, and flexbox render correctly), and has no daily conversion cap on the free tier. It's a clean drop-in for this pattern.
Best Free File Conversion API for n8n in 2026
The best free file conversion API for n8n is one that covers the formats your workflow actually needs, integrates cleanly with the HTTP Request node (API key, not OAuth), and won't silently fail at 3 AM when it hits a daily limit.
Here's how the main options compare across the criteria that matter for automation:
| API | Free Tier | Daily Cap | PDF → DOCX | HTML → PDF | PDF → Image/TIFF | Auth Method |
|---|---|---|---|---|---|---|
| Convertfleet | Full feature access | None | Yes | Yes (Chromium) | Yes | API key |
| CloudConvert | Limited credits | ~25/day | Yes | Yes (Chromium) | Yes | API key |
| Zamzar | Trial credits | 100/day | Yes | Limited engine | Yes | API key |
| Adobe PDF Services | 500/month free | ~17/day avg | Yes (high accuracy) | Yes | OAuth 2.0 | |
| ILovePDF API | Trial credits | 200/day | Yes | Limited | Yes | API key |
For HTML to PDF: Convertfleet and CloudConvert both use Chromium-based rendering. Modern CSS layouts, flexbox, Google Fonts, and media queries all work. Zamzar's HTML engine struggles with anything beyond basic HTML 4-era markup — test with your actual templates before committing.
For PDF to Word (DOCX): Accuracy varies significantly by document complexity. Adobe PDF Services handles multi-column layouts and embedded tables most reliably but requires OAuth, which adds 30+ minutes to your n8n setup and a credentials refresh step. Convertfleet and CloudConvert both offer solid accuracy with simpler API key auth — good enough for most business documents.
For PDF to TIFF (a hard requirement in legal, medical, and archival document workflows): Convertfleet, CloudConvert, and ILovePDF all support it. Pay attention to the default DPI setting — most APIs default to 72 DPI (screen resolution). Legal and archival use cases typically require 300 DPI; always pass DPI explicitly rather than relying on defaults.
On pricing for high-volume and price-sensitive markets: If you're running thousands of conversions per month, per-conversion pricing adds up regardless of geography. A free-tier API with no daily cap is the cheapest option at any volume — whether you're in India building a document automation SaaS or a US startup processing customer uploads.
See also: our complete file conversion API guide for a deeper breakdown of API capabilities and pricing tiers.
n8n Convert to Text File: Saving Strings and Extracting Document Content
"Convert to text file" in n8n covers two opposite operations: saving a text string as a .txt file (Convert to File node), and extracting plain text from a PDF or document (Extract from File node). Knowing which node does which saves a lot of confused Googling.
Saving a string as a .txt file is the simplest operation the Convert to File node offers. Set Operation to "Plain Text". Point "Input Data Field Name" at the string field. Set a filename. The output is a proper .txt binary item. Useful for log exports, plain-text report generation, or creating flat files for systems that don't accept JSON.
Extracting text from a PDF or DOCX is the reverse — use the "Extract from File" node, Operation "Text". For PDFs, n8n uses the pdf-parse library under the hood. It extracts embedded text reliably from text-based PDFs, outputs it as a string field, and you can pass it to an AI node, a Set node, or anywhere else in your workflow.
Limitations worth knowing upfront:
- n8n's built-in PDF extraction strips all formatting — no headings, no tables, no columns. You get raw text in reading order.
- Scanned PDFs (images with no embedded text layer) return empty strings. These require an OCR API call — n8n cannot handle them natively.
- For structured extraction (preserving table rows, detecting headings, extracting specific fields), you'll get far better results from a dedicated extraction API or passing the raw text to an LLM node with a structured output schema.
DOCX to PDF, PDF to Image, and Cross-Format Conversions in n8n
For DOCX → PDF and PDF → image conversions, the HTTP Request node configuration differs depending on whether the API accepts multipart file uploads or Base64-encoded JSON payloads. Getting this wrong produces cryptic 400 errors that are hard to debug without knowing what to look for.
For APIs that accept multipart/form-data (most file upload APIs):
Set the HTTP Request node's Body Content Type to "Form-Data". Add one parameter of type "File" and point it at your binary field name (e.g., data). Add additional parameters for output format, DPI, page range, etc. as regular form fields. The API receives the file as a standard HTTP file upload.
For APIs that accept Base64-encoded JSON:
Use an "Extract from File" node first to convert your binary item to a Base64 string. Then set the HTTP Request Body Content Type to "JSON" and pass the Base64 string in the field the API expects. This pattern is common with older REST APIs and some enterprise platforms.
PDF to image — key parameters to always set explicitly:
| Parameter | Value | When to Use |
|---|---|---|
dpi |
72 | Web thumbnails, quick previews |
dpi |
150 | Print previews, vision AI input |
dpi |
300 | Archival, legal, medical records |
page |
1 |
Cover thumbnails |
page |
all |
Full document processing |
format |
png |
Transparency needed |
format |
jpg |
Smaller file size |
format |
tiff |
Archival standards |
A practical example of why this matters: a PDF-to-image workflow that feeds a vision AI model downstream (OpenAI, Claude, Gemini) needs at least 150 DPI for readable text recognition. At 72 DPI, OCR accuracy drops sharply. Set dpi=150 explicitly in your API call, then use the Convert to File node to handle the Base64 response if needed.
For n8n PDF automation patterns that combine conversion with AI processing, the HTTP Request → Convert to File → LLM node chain is the most common production pattern we see.
Common Mistakes and Pitfalls When Using the n8n Convert to File Node
These are the failure modes that come up repeatedly in n8n community threads, Discord, and support channels — usually after something breaks in production.
1. Not setting the MIME type when decoding Base64
If you skip MIME type on the "Move Base64 String to File" operation, downstream nodes behave unpredictably: email nodes may not attach the file, S3 uploads store it with application/octet-stream content type, and browsers won't open it correctly. Always set MIME type explicitly (application/pdf, image/png, application/vnd.openxmlformats-officedocument.wordprocessingml.document). Don't trust filename extension guessing.
2. Passing a single object instead of an array to CSV
The CSV operation expects an array of objects: [{...}, {...}]. If your upstream node outputs a single object {...} (common after a "Set" node creates one item), you get a one-row CSV or garbled output. Fix: wrap the single object in an array expression in the Set node — ={{ [$json] }} — before passing to Convert to File.
3. Skipping the "Aggregate" node before multi-item CSV exports Each n8n workflow item processes independently. 100 database rows = 100 separate single-row CSV files unless you aggregate first. Add the "Aggregate" node (Core, v1.x+) before Convert to File, set it to aggregate all items into a single list, then pass that to CSV. This is the #1 structural mistake in n8n file export workflows.
4. No error handling on external API calls in loops If your workflow calls a conversion API inside a "Loop Over Items" pattern and the API returns a 429 (rate limited) or 500 on item 43 of 200, n8n will fail that iteration and move on — or halt the workflow — depending on your error settings. Neither is what you want. Add an IF node after every HTTP Request to check the response code, route errors to a "Stop and Error" node, and use a "Wait" node with exponential backoff for retries.
5. Expecting the HTML operation to produce a PDF
The "HTML" operation in Convert to File saves your HTML string as a .html file — it does not render or convert it to PDF. This is a very common misread of the node's label. If you need a PDF, you must make an external API call to a rendering service. The HTML operation is useful for creating email templates or archiving raw markup, not for PDF output.
6. Ignoring file size bloat from Base64 That 33% inflation matters at scale.Test your workflow with realistic file sizes. A 10 MB PDF becomes ~13.7 MB as Base64 — if you're storing thousands in a database or passing them between services, bandwidth and storage costs compound fast. For high-volume workflows, prefer APIs that return binary streams directly.
Free Download: n8n File Conversion Workflow JSON
Grab the ready-made workflow below and import it directly into your n8n instance. It covers the most common pattern: JSON array → CSV → email, with error handling and dynamic filenames built in.
How to use:
1. Copy the JSON below
2. In n8n, click "Import from File" or paste into the workflow JSON editor
3. Replace YOUR_EMAIL with your actual address
4. Run the test execution
{
"name": "Convert to File - CSV Export with Error Handling",
"nodes": [
{
"parameters": {},
"id": "1",
"name": "When clicking \"Execute Workflow\"",
"type": "n8n-nodes-base.manualTrigger",
"typeVersion": 1,
"position": [250, 300]
},
{
"parameters": {
"values": {
"string": [
{
"name": "data",
"value": "[{\"name\":\"Alice\",\"score\":92},{\"name\":\"Bob\",\"score\":87}]"
}
]
}
},
"id": "2",
"name": "Set Sample Data",
"type": "n8n-nodes-base.set",
"typeVersion": 2,
"position": [450, 300]
},
{
"parameters": {
"operation": "csv",
"options": {
"fileName": "report-{{ $now.format('yyyy-MM-dd') }}.csv"
}
},
"id": "3",
"name": "Convert to File",
"type": "n8n-nodes-base.convertToFile",
"typeVersion": 1,
"position": [650, 300]
},
{
"parameters": {
"sendTo": "YOUR_EMAIL",
"subject": "Daily Report",
"text": "Attached: daily report CSV"
},
"id": "4",
"name": "Send Email",
"type": "n8n-nodes-base.gmail",
"typeVersion": 2,
"position": [850, 300]
}
],
"connections": {
"When clicking \"Execute Workflow\"": {
"main": [[{"node":"Set Sample Data","type":"main","index":0}]]
},
"Set Sample Data": {
"main": [[{"node":"Convert to File","type":"main","index":0}]]
},
"Convert to File": {
"main": [[{"node":"Send Email","type":"main","index":0}]]
}
}
}
For the full PDF conversion workflow (HTML → PDF via API with Base64 decode), check our n8n PDF automation guide.
Frequently Asked Questions
What is the n8n Convert to File node used for? The Convert to File node converts structured data (JSON arrays, text strings) or Base64-encoded binary data into downloadable file objects inside an n8n workflow. It natively supports CSV, XLSX, ODS, HTML, ICS, RTF, plain text, and Base64-to-binary decoding. For PDF generation or cross-format conversion (DOCX to PDF, PDF to image), you need an HTTP Request node calling an external file conversion API — the node has no PDF capability of its own.
How do I convert files inside an n8n automation without hitting rate limits? Choose a file conversion API that offers a genuinely free tier with no daily cap. CloudConvert's free tier limits usage to approximately 25 conversion credits per day — easy to exceed in production. Convertfleet offers 177+ format support including PDF, DOCX, HTML-to-PDF, and image conversions with no daily cap on the free tier, making it a more reliable choice for overnight automation runs that process hundreds of files.
What is the best free file conversion API for n8n workflows? For most n8n workflows, the best option is one that uses API key authentication (not OAuth), returns binary or Base64 cleanly, and imposes no daily conversion limit. Convertfleet meets all three criteria and supports 177+ formats with a simple HTTP Request node setup. CloudConvert is more feature-rich and well-documented but caps free usage at around 25 conversions per day, limiting its suitability for production automation.
Can I convert PDF to Word (DOCX) using an API in n8n? Yes. Send your PDF binary to a PDF-to-DOCX conversion API via the HTTP Request node — either as multipart/form-data (direct binary upload) or as a Base64-encoded JSON field. The API returns a DOCX file, either as a binary stream or Base64. If it's Base64, decode it with the Convert to File node. Convertfleet, CloudConvert, and Adobe PDF Services all support this; Adobe offers the highest accuracy on complex multi-column layouts but requires OAuth setup.
How do I convert an HTTP API response (HTML or JSON) to a PDF in n8n? Build your HTML string using a Set or Code node, then POST it to an HTML-to-PDF rendering API via HTTP Request. The API renders the HTML in a headless browser and returns a PDF. If the response is Base64-encoded, decode it with the Convert to File node; if it's a direct binary stream, pass it straight to your delivery node (S3, email, Google Drive). Chromium-based rendering APIs (Convertfleet, CloudConvert) support modern CSS, flexbox, and web fonts — older rendering engines do not.
Why does my Base64-decoded file open as corrupted or with the wrong type?
Almost always because the MIME type was not set explicitly in the Convert to File node. The node does not reliably infer MIME type from filename extension. Always set it: application/pdf for PDFs, image/png for PNGs, application/vnd.openxmlformats-officedocument.wordprocessingml.document for DOCX. Also check that your Base64 string doesn't include a data: URI prefix — strip that first.
Conclusion
The n8n Convert to File node is exactly as powerful as its format list suggests — CSV exports, Base64 decoding, text file generation — and exactly as limited when it comes to PDFs. The two most common production failures are treating the node as a PDF tool (it isn't) and calling rate-limited conversion APIs inside loops without error handling (they break).
The pattern that works reliably at scale: use the native node for structured data exports, route all PDF and cross-format work through an external HTTP call, and pick an API that won't cap out mid-run. If you're evaluating options, Convertfleet's free conversion API supports 177+ formats including PDF-to-DOCX, HTML-to-PDF, PDF-to-TIFF, and more — no registration required, no daily limit, and a straightforward API key setup that pairs directly with n8n's HTTP Request node.
Read next

Developer & APIs · Jul 15, 2026
File Conversion MCP Tool: Add It to Claude Code in 5 Min
Turn Convertfleet into a file conversion MCP server for Claude Code, Cursor, or any AI agent. Free tool-definition JSON included for automation workflow tools.

File Conversion · Jul 15, 2026
File Conversion API: 2025 Guide to Replacing 123apps at Scale
Hit limits with 123apps? Learn when free file conversion online tools stop scaling and how a file conversion API like Convert Fleet fixes batch, automation, and quality.

Automation & Workflows · Jul 15, 2026
How to Automate File Conversion in Pipedream: Audio, PDF & Video
Learn how to automate file conversion in Pipedream with a free API. Build workflows that convert audio, PDF, and video without managing ffmpeg or Lambda.