A free, open-source online Markdown editor with live preview, rich text editing, and export capabilities. No sign-up required.
Website: https://dotmdeditor.dev
- Live Preview - See your Markdown rendered in real-time as you type
- Dual Editing Modes - Write in Markdown or edit directly in the rich text preview
- Formatting Toolbar - Quick access to common formatting options (bold, italic, headings, lists, etc.)
- Export Options - Download your document as PDF or Markdown (.md) file
- Share via URL - Generate a shareable link that embeds your document (no server storage)
- Auto-save - Content is automatically saved to local storage
- Mobile Responsive - Works on desktop, tablet, and mobile devices
- Keyboard Shortcuts - Boost productivity with common shortcuts
- XSS Protection - Sanitized HTML output using DOMPurify
- PWA Ready - Install as a Progressive Web App
| Shortcut | Action |
|---|---|
Ctrl/Cmd + B |
Bold |
Ctrl/Cmd + I |
Italic |
Ctrl/Cmd + K |
Insert Link |
Tab |
Insert 4 spaces |
- React 19 - UI framework
- Vite - Build tool and dev server
- Tailwind CSS 4 - Styling
- marked - Markdown parsing
- DOMPurify - HTML sanitization
- Turndown - HTML to Markdown conversion
- LZ-String - URL compression for sharing
- html2pdf.js - PDF export
- Node.js 18+
- npm or yarn
-
Clone the repository:
git clone https://github.com/yourusername/markdown-editor-and-viewer.git cd markdown-editor-and-viewer -
Install dependencies:
npm install
-
Create environment file:
cp .env.example .env
-
(Optional) Add your Google Analytics ID to
.env:VITE_GA_ID=G-XXXXXXXXXX -
Start the development server:
npm run dev
-
Open http://localhost:5173 in your browser.
npm run buildThe built files will be in the dist directory, ready to deploy to any static hosting service.
npm run preview├── public/
│ ├── favicon.svg # App favicon
│ ├── manifest.json # PWA manifest
│ └── og-image.png # Social sharing image
├── src/
│ ├── components/
│ │ ├── ConfirmModal.jsx # Confirmation dialogs
│ │ ├── Editor.jsx # Markdown editor with toolbar
│ │ ├── EditorToolbar.jsx # Formatting toolbar
│ │ ├── ExportModal.jsx # Export options (PDF, MD)
│ │ ├── Header.jsx # App header with actions
│ │ ├── Icons.jsx # SVG icon components
│ │ ├── Preview.jsx # Live preview with rich editing
│ │ ├── ShareModal.jsx # Share link generator
│ │ └── Toast.jsx # Toast notifications
│ ├── App.jsx # Main application component
│ ├── index.css # Global styles and Tailwind
│ └── main.jsx # App entry point
├── index.html # HTML template with SEO meta tags
├── .env.example # Environment variables template
└── package.json
| Variable | Description |
|---|---|
VITE_GA_ID |
Google Analytics 4 Measurement ID |
This is a static site that can be deployed to any hosting platform:
- Vercel: Connect your repo for automatic deployments
- Netlify: Drag and drop the
distfolder or connect your repo - GitHub Pages: Use the
gh-pagesbranch - Cloudflare Pages: Connect your repo
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is open source and available under the GNU GENERAL PUBLIC LICENSE.
- marked - Markdown parser
- Turndown - HTML to Markdown converter
- DOMPurify - XSS sanitizer
- Tailwind CSS - CSS framework