Building blocks and outside APIs · Library

CodeMirror

An open-source code editor for web pages, with syntax highlighting, autocomplete, search and multiple cursors, light enough to embed anywhere.

Editors · Open source · updated

How it works

CodeMirror 6 is built from small modules: language support, themes, linting, autocompletion and key bindings are all extensions you add. Highlighting uses Lezer, an incremental parser that re-reads only what changed, so large files stay responsive, and the editor was designed with touch screens and screen readers in mind. Its author, Marijn Haverbeke, also created ProseMirror, the engine under TipTap.

The main alternative is Monaco, the editor from VS Code, which brings more IDE features out of the box but is heavier and does not support mobile browsers. CodeMirror suits code playgrounds, SQL consoles, config editors, Markdown source editing and in-app scripting. It edits plain text; for formatted documents with bold and images, a rich text toolkit such as TipTap fits instead.

CodeMirror pricing

Open source

Free (MIT).

Approximate, checked September 2026.What the other tools cost

CodeMirror vs the alternatives

More in Building blocks and outside APIs

Editors

All 14 Building blocks and outside APIs terms

Crafted in the dark. Shipped to the world.

Tell us what you are building. You get a private project space with a proposal and a line-by-line quote within a day.