Skip to content

shauqiiskandar/Text-File-Converter-Formatter

Repository files navigation

Text File Converter

Browser-based file converter that transforms documents between formats with a clean drag-and-drop interface.

Features

Input Formats

  • PDF (.pdf) - Extracts text from PDF documents
  • Word (.docx) - Parses Word documents with heading detection
  • Markdown (.md) - Reads markdown files
  • Plain Text (.txt) - Reads plain text files

Output Formats

  • Word (.docx) - Generates Word documents
  • Markdown (.md) - Converts to markdown
  • Plain Text (.txt) - Outputs plain text
  • HTML (.html) - Renders as HTML
  • PDF (.pdf) - Generates PDF documents

Smart Features

  • Drag-and-drop or click-to-browse upload
  • Heading detection from Word docs (by style or bold+font-size)
  • Live preview of converted text in browser
  • Real-time format selector
  • AI Format toggle — on Single and Batch pages. When output is .md, toggle this on to have an LLM restructure heading hierarchy, clean up decorative characters, and fix spacing in one step. Greyed out for non-markdown outputs.
  • AI Formatter tab — paste or drop markdown directly, format with AI, copy/download

Setup

npm install
npm start

Open http://localhost:3001

Usage — Web UI

  1. Upload file via drag-drop or browse
  2. Select output format from dropdown
  3. (Optional) Toggle "Format with AI after conversion" — requires entering API credentials in the AI Formatter tab first
  4. Click Convert
  5. Preview appears in download zone
  6. Click Download to save

Batch upload: Switch to the "Batch Upload" tab to convert multiple files at once. Upload several files, pick an output format, click "Convert All", then download individually or as a ZIP.

Usage — CLI (batch convert)

Convert all supported files in a folder to a single output format without opening a browser:

batch-convert --input <folder> --output <folder> --format <format>
Option Description
--input Source folder containing files to convert (required)
--output Destination folder for converted files (required)
--format Output format: docx, md, txt, html, or pdf (required)
--verbose Show per-file progress

Examples:

batch-convert --input ./source --output ./converted --format md
batch-convert --input ./docs --output ./html --format html --verbose

You can also run it directly with Node:

node batch-convert.js --input ./source --output ./converted --format txt

License

MIT License

About

Convert text documents and format converted documents with AI

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors