JavaScript code editor libraries

Updated Nov 2026

JavaScript code editor libraries embed an editable code area with syntax highlighting in a web page. Overlay editors lay highlighted text under a plain textarea rather than keeping a document model of their own. These libraries supply the code inputs in documentation playgrounds, admin consoles, and browser-based development tools.

Popularity

CodeMirror has the most monthly downloads in this comparison, at 90.6M.

LibraryMonthly downloadsStarsLast releaseLicense
CodeMirror
90.6M
178Oct 2026MIT
Monaco Editor
51.9M
47.0KSep 2026MIT
Ace
7.9M
3.1KOct 2026BSD-3-Clause
react-simple-code-editor
5.3M
1.7KJul 2024MIT
React Textarea Code Editor
779.4K
579Nov 2026MIT
CodeJar
170.2K
2.0KNov 2026MIT
Yace
113.3K
187Sep 2026MIT
prism-code-editor
107.5K
161Sep 2026MIT
Downloads: npm, last thirty days. Stars and releases: GitHub. Amber: no release in over a year.

Libraries and code examples

Provides the view layer of a modular browser text and code editor.

Downloads / mo
90.6M
Stars
178
Last release
6.43.15
License
MIT

Strengths

  • Selects features through separate modules. Choose the editor features the application needs.
  • Adds configurable gutter controls. Use line numbers or build custom controls beside the code.

Limitations

  • Editing features need assembly. Install and import the separate editing features the application needs.

Quickstart

From Basic setup example
$ npm install @codemirror/view@6.43.15 codemirror@6.0.2
import { basicSetup } from 'codemirror';
import { EditorView } from '@codemirror/view';
new EditorView({ doc: 'Hello world', parent: document.body, extensions: [basicSetup] });

CodeMirror examples

From open-source projects on GitHub

Provides the browser editor generated from Visual Studio Code sources.

Downloads / mo
51.9M
Stars
47.0K
Last release
0.57.0
License
MIT

Strengths

  • Supports language completion providers. Add completion items for the current document and cursor position.
  • Allows custom syntax highlighting. Define syntax highlighting through a declarative Monarch specification.

Limitations

  • Workers need a web server. Serve the editor over HTTP or HTTPS so workers can start.
  • Mobile browsers are unsupported. Choose another editor when mobile browser support is required.

Quickstart

From integrate-esm.md
$ npm install monaco-editor@0.57.0
import * as monaco from 'monaco-editor/esm/vs/editor/editor.api';
import EditorWorker from 'monaco-editor/esm/vs/editor/editor.worker?worker';
self.MonacoEnvironment = { getWorker: () => new EditorWorker() };
const host = document.body.appendChild(document.createElement('div'));
host.style.height = '200px';
monaco.editor.create(host, { value: 'Hello world', language: 'plaintext' });

Monaco Editor examples

From open-source projects on GitHub

Provides prepackaged browser builds of the Ace code editor.

Downloads / mo
7.9M
Stars
3.1K
Last release
1.45.2
License
BSD-3-Clause

Strengths

  • Groups edits for undo. Control which edits belong to the same undo step.
  • Supports editor markers. Add editor ranges with custom styles through the session marker API.

Limitations

  • Completion needs its extension file. Load ext-language_tools.js before enabling autocomplete.

Quickstart

From How-to guide
$ npm install ace-builds@1.45.2
import * as ace from 'ace-builds';
const host = document.body.appendChild(document.createElement('div'));
host.style.height = '200px';
ace.edit(host, { value: 'Hello world', mode: 'ace/mode/text' });

Ace examples

From open-source projects on GitHub

react-simple-code-editor

Renders a React code editor that takes its syntax highlighting from a third-party library.

Downloads / mo
5.3M
Stars
1.7K
Last release
0.14.1
License
MIT

Strengths

  • Undoes whole words. Each undo step removes a whole word instead of one letter.

Limitations

  • Value must be controlled. Update the value prop from onValueChange on every change.

Quickstart

From README.md
$ npm install react-simple-code-editor@0.14.1 react@19.2.0 react-dom@19.2.0 prismjs@1.30.0
import { useState } from 'react';
import Editor from 'react-simple-code-editor';
import { highlight, languages } from 'prismjs';
import 'prismjs/components/prism-clike';
import 'prismjs/components/prism-javascript';

export default function App() {
  const [value, setValue] = useState('const answer = 42;');
  return <Editor value={value} onValueChange={setValue} highlight={code => highlight(code, languages.js, 'javascript')} style={{ fontFamily: 'monospace', fontSize: 14 }} />;
}

react-simple-code-editor examples

From open-source projects on GitHub

React Textarea Code Editor

Renders a React textarea code editor with built-in syntax highlighting for embeds and forms.

Downloads / mo
779.4K
Stars
579
Last release
3.1.3
License
MIT

Strengths

  • Highlights code automatically. Colors code without a highlighter supplied by the app.

Limitations

  • Next.js needs extra setup. Load the editor in Next.js with a dynamic import and server rendering turned off.

Quickstart

From README.md
$ npm install @uiw/react-textarea-code-editor@3.1.3 react@19.2.0 react-dom@19.2.0 less
import { useState } from 'react';
import CodeEditor from '@uiw/react-textarea-code-editor';

export default function App() {
  const [value, setValue] = useState('const answer = 42;');
  return <CodeEditor value={value} language="js" onChange={event => setValue(event.target.value)} />;
}

React Textarea Code Editor examples

From open-source projects on GitHub

Provides an embeddable browser code editor using a contenteditable host.

Downloads / mo
170.2K
Stars
2.0K
Last release
5.0.0
License
MIT

Strengths

  • Edits highlighted content directly. Type directly in the highlighted contenteditable host.
  • Includes optional undo history. Undo and redo are enabled through the history option.

Limitations

  • Needs a syntax highlighter. Supply a highlighter such as Prism to color the code.
  • Line numbers need an addon. Use the separate line-number package with the current major.

Quickstart

From README.md
$ npm install codejar@5.0.0 prismjs@1.30.0
import { CodeJar } from 'codejar';
import Prism from 'prismjs';
import 'prismjs/themes/prism.css';
const host = document.body.appendChild(document.createElement('pre'));
host.textContent = 'const answer = 42;';
CodeJar(host, element => {
  element.innerHTML = Prism.highlight(element.textContent ?? '', Prism.languages.js, 'js');
});

CodeJar examples

From open-source projects on GitHub

Provides a small code editor component with zero dependencies that works in any framework.

Downloads / mo
113.3K
Stars
187
Last release
1.1.1
License
MIT

Strengths

  • Plugins shape each edit. Each plugin receives the textarea state and returns the next text and selection.

Limitations

  • Small documents only. Large documents, multicursor editing, rich text, and server rendering are out of scope.

Quickstart

From README.md
$ npm install yace@1.1.1
import { Yace } from 'yace';
import { code } from 'yace/highlighters/code';
import { history, tab, preserveIndent } from 'yace/plugins';
const host = document.body.appendChild(document.createElement('div'));
new Yace(host, { value: 'const answer = 42;', lineNumbers: true, highlighters: [code()], plugins: [history(), tab(), preserveIndent()] });

Yace examples

From open-source projects on GitHub
() => {
    const editor = editorRef.current
    if (!editor || editor.value === value) {
      return
    }

    editor.update({ value })
  }

prism-code-editor

Overlays Prism-highlighted code on a textarea and splits it into lines for line numbers and partial updates.

Downloads / mo
107.5K
Stars
161
Last release
5.4.0
License
MIT

Strengths

  • Works on mobile. Editing works in mobile browsers as well as on the desktop.
  • Ships ready-made setups. Each setup imports its styles, extensions, and language behavior in one call.

Quickstart

From readme.md
$ npm install prism-code-editor@5.4.0
import { basicEditor } from 'prism-code-editor/setups';
import 'prism-code-editor/prism/languages/markup';
const host = document.body.appendChild(document.createElement('div'));
host.style.display = 'grid';
basicEditor(host, { language: 'html', theme: 'github-dark', value: '<h1>Hello world</h1>' });

prism-code-editor examples

From open-source projects on GitHub

FAQ

CodeMirror assembles the editor from separate modules, and an app installs only the features it needs. Monaco Editor is generated from Visual Studio Code's sources and brings language completion providers. Monaco does not support mobile browsers.

Monaco Editor and Ace also provide full browser editors. For a small embed or a form field, react-simple-code-editor, Yace, and CodeJar highlight code over a plain editing surface.

CodeMirror has the most monthly downloads in this comparison, at 90.6M for its view package.

Load Monaco from an HTTP or HTTPS server rather than a file URL for worker support.

CodeMirror uses separate modules that must be installed and imported. The own basic setup imports history and language support from separate packages.

The autocomplete options require the shipped ext-language_tools.js file.

For coding agents

Found your code editor library? Help your agent use it.

Connect Exa so your coding agent can find the library’s documentation, check its API, and look up implementations while you build.

Run in your terminal

claude plugin install exa@claude-plugins-official