Drag & drop a file here, or paste directly into the box below
2. Fields (select which fields become page_content vs metadata)
Field
Type
Content
Metadata
Content fields (merge order)
Use \n for newline. Multiple selected fields are joined with this separator into page_content.
Metadata fields (order & rename)
3. Extra metadata & options
4. Custom metadata mapping (static key/value added to every document)
5. Chunking
6. Run
7. Stats
8. Preview
9. Export
Convert some documents on the Convert tab first — code here is generated from your current output.
Document constructor code
Loader code (Python JSONLoader)
Embedding pipeline example
Vector database export
This export includes id/page_content/metadata for every document; embeddings aren't computed here — plug the vectors in with your chosen embedding model.
Sample templates
Save current configuration
Saved profiles
No saved profiles yet. Stored in this browser only.
Share configuration via URL
Encodes your field mapping and options (not your data) into a link so a teammate can open the same setup.
Automation API
Everything here also runs as a plain JS function you can call from the console:
A hosted HTTP API for server-side automation is on the roadmap — for now, conversion is fully client-side.
Convert JSON to LangChain Document Format Online
Preparing structured data for AI applications often requires converting files into
LangChain's Document format. Whether your data is stored as JSON,
CSV, Markdown, HTML, XML, YAML, or Excel spreadsheets, this converter helps transform
your records into clean LangChain Documents without writing custom scripts.
Instead of manually building Document(page_content="", metadata={})
objects or creating complex preprocessing pipelines, you can upload your dataset,
select which fields should become document content, map metadata, configure chunking,
and export ready-to-use Python or JavaScript code for your LangChain projects.
Everything runs locally in your browser, helping keep your data private.
This tool is particularly useful when preparing datasets for Retrieval-Augmented
Generation (RAG), semantic search, vector databases, chatbots, AI assistants,
knowledge bases, customer support systems, and document indexing pipelines.
Key Features
Multiple input formats
Import JSON arrays, CSV files, Markdown documents, HTML pages, XML, YAML, and Excel
workbooks without requiring additional conversion tools.
Automatic field detection
The converter analyzes your uploaded file and automatically detects available fields
or columns so you can quickly configure your document mapping.
Flexible content mapping
Choose one or multiple fields to become the LangChain
page_content. Multiple fields can be merged using custom separators.
Metadata mapping
Assign any field as metadata while preserving useful information such as document IDs,
categories, authors, timestamps, URLs, languages, or tags.
Custom metadata
Attach static metadata values that are automatically added to every generated
document, making downstream filtering easier.
Chunking support
Prepare long documents for embeddings by configuring chunk sizes and chunk overlap
before exporting your dataset.
Privacy friendly
Processing occurs entirely inside your browser. Your uploaded data is not sent to
external servers during conversion.
Ready-to-use code generation
Generate Python or JavaScript examples showing exactly how the converted documents
can be loaded into LangChain applications.
Vector database compatibility
Export datasets suitable for Pinecone, ChromaDB, Weaviate, Qdrant, FAISS, Milvus,
and Elasticsearch workflows.
Profile saving
Save conversion configurations and reuse them later for recurring datasets with the
same structure.
Why Convert Data into LangChain Documents?
LangChain standardizes documents using two primary properties:
page_content — the searchable text used to generate embeddings.
metadata — structured information such as IDs, URLs,
categories, authors, timestamps, product types, languages, or tags.
Keeping content and metadata separate makes it easier to build efficient AI systems.
The language model searches and embeds only the relevant text while metadata enables
advanced filtering, ranking, source attribution, and document retrieval.
Instead of manually constructing hundreds or thousands of Document objects, this
converter automates the entire process with a visual interface.
How the Converter Works
Upload your dataset
Choose a supported file such as JSON, CSV, Markdown, HTML, XML, YAML, or Excel.
The converter automatically detects its structure.
Validate and parse
The parser reads your records and displays all available fields for mapping.
This allows you to verify that the data has been imported correctly before
continuing.
Select content fields
Choose one or more columns that should become the
page_content. When multiple fields are selected, they are merged using
your chosen separator.
Configure metadata
Mark fields that should remain as metadata, optionally rename them, add custom
metadata values, specify source URLs, filenames, language, tags, and document IDs.
How the LangChain Document Converter Works
The converter simplifies the process of transforming structured and semi-structured files into the
LangChain Document format used by Retrieval-Augmented Generation (RAG) applications,
AI assistants, semantic search systems, and vector databases. Instead of manually writing parsing
scripts, you can upload your data, select which fields represent content and metadata, configure
optional chunking, and export production-ready output within seconds.
Every input record is converted into a LangChain Document object containing two primary sections:
page_content and metadata. The page content becomes the searchable text,
while metadata stores additional information such as titles, categories, authors, source URLs,
filenames, document IDs, tags, or any custom fields you choose.
Select the input format such as JSON, CSV, Markdown, HTML, XML, YAML, or Excel.
Upload your file or paste the content into the editor.
Validate and parse the input automatically.
Choose which fields become page content and which become metadata.
Add optional metadata like source URL, language, tags, or filename.
Configure chunking settings if your documents contain long text.
Preview the generated LangChain Documents.
Export as JSON, JSONL, TXT, Python, JavaScript, or vector database templates.
Everything runs directly in your browser, helping keep your documents private while allowing you to
inspect the generated output before using it in your LangChain pipeline.
Supported Input Formats
The converter accepts multiple popular file formats commonly used in AI, data engineering,
documentation, and enterprise workflows.
HTML – Web pages, blog articles, documentation sites, exported web content.
XML – RSS feeds, sitemap files, enterprise integrations, structured documents.
YAML – Configuration files and lightweight structured content.
Excel (.xlsx) – Business reports, financial spreadsheets, survey results, and tabular datasets.
Regardless of the source format, the output follows the same LangChain Document structure, making
it easy to integrate with embedding models and vector databases.
Worked Example
Suppose you have the following CSV file containing a product catalog:
This document is now ready for chunking, embedding generation, vector database indexing,
semantic search, or use within a Retrieval-Augmented Generation (RAG) application powered by
LangChain.
Best Practices for Creating LangChain Documents
Following a few best practices can improve the quality of your LangChain Documents and produce
better search, retrieval, and AI-generated responses.
Choose descriptive text fields for page_content instead of IDs or numeric values.
Store useful information such as categories, authors, tags, URLs, and timestamps as metadata.
Remove duplicate records before generating embeddings.
Use chunking for long documents to improve retrieval accuracy.
Keep metadata consistent across all documents.
Verify the preview before exporting to ensure fields are mapped correctly.
Include source URLs whenever possible for easier traceability.
Use meaningful filenames and document IDs for future maintenance.
Select the appropriate export format based on your LangChain application.
Test the generated documents with your embedding model before indexing a large dataset.
Common Errors and How to Fix Them
Error
Possible Cause
Solution
Empty page_content
No content fields selected
Select one or more fields as page content.
Missing metadata
Metadata fields not mapped
Select the required metadata fields before exporting.
Parser validation failed
Invalid JSON, XML, or CSV syntax
Validate the input file before uploading.
Duplicate documents
Repeated records in the dataset
Enable duplicate removal or clean the source file.
Poor search quality
Very short page content
Combine multiple descriptive fields into page content.
Large embedding costs
Very large documents
Split documents using chunking before embedding.
Conclusion
Converting structured data into the LangChain Document format is an essential step when
building AI-powered applications that rely on semantic search or Retrieval-Augmented
Generation. This converter simplifies the entire workflow by supporting multiple input
formats, flexible content and metadata mapping, configurable chunking, live previews,
and exports for Python, JavaScript, and vector database pipelines.
Whether your data originates from JSON APIs, CSV spreadsheets, Markdown documentation,
HTML pages, XML feeds, YAML configuration files, or Excel workbooks, the converter helps
produce consistent LangChain Documents that integrate seamlessly into modern AI and LLM
applications.
Frequently Asked Questions (FAQ)
1. What is a LangChain Document?
A LangChain Document is a standardized object containing searchable text in page_content and additional information stored as metadata.
2. Which file formats are supported?
The converter supports JSON, CSV, Markdown, HTML, XML, YAML, and Excel (.xlsx) files.
3. Does the converter upload my files?
No. The converter performs parsing and conversion locally in your browser, helping keep your data private.
4. What is page_content?
It is the primary text that embedding models index and search when retrieving relevant information.
5. What is metadata used for?
Metadata stores additional information such as categories, authors, document IDs, filenames,source URLs, and tags that can be used for filtering and search.
6. Should I enable chunking?
Chunking is recommended for long articles, documentation, manuals, and knowledge bases.Smaller chunks usually improve retrieval quality in RAG applications.
7. Can I export code?
Yes. The converter can generate ready-to-use Python and JavaScript code for creating LangChain Documents and loading them into your application.
8. Which vector databases are supported?
The generated documents can be used with popular vector databases including Pinecone, ChromaDB, Weaviate, Qdrant, FAISS, Milvus, and Elasticsearch after embedding generation.
9. Can I add custom metadata?
Yes. You can define custom key-value metadata fields that are added to every generated document.
10. Is this tool suitable for RAG applications?
Yes. The converter is specifically designed to prepare documents for Retrieval-Augmented Generation (RAG), semantic search, AI chatbots, and other LangChain-powered workflows.