# JavaScript code editor libraries

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

| Library | Monthly downloads | Stars | Last release | License |
| --- | --- | --- | --- | --- |
| [CodeMirror](#codemirror) | 90.6M | 178 | Oct 2026 | MIT |
| [Monaco Editor](#monaco-editor) | 51.9M | 47.0K | Sep 2026 | MIT |
| [Ace](#ace) | 7.9M | 3.1K | Oct 2026 | BSD-3-Clause |
| [react-simple-code-editor](#react-simple-code-editor) | 5.3M | 1.7K | Jul 2024 | MIT |
| [React Textarea Code Editor](#uiw-react-textarea-code-editor) | 779.4K | 579 | Nov 2026 | MIT |
| [CodeJar](#codejar) | 170.2K | 2.0K | Nov 2026 | MIT |
| [Yace](#yace) | 113.3K | 187 | Sep 2026 | MIT |
| [prism-code-editor](#prism-code-editor) | 107.5K | 161 | Sep 2026 | MIT |

Downloads: npm, last thirty days. Stars and releases: GitHub. Amber: no release in over a year.

[CodeMirror](#codemirror) has the most monthly downloads in this comparison, at 90.6M.

## Capabilities

| Library | React required | Caller supplies highlighter |
| --- | --- | --- |
| [CodeMirror](#codemirror) | No | No |
| [Monaco Editor](#monaco-editor) | No | No |
| [Ace](#ace) | No | No |
| [react-simple-code-editor](#react-simple-code-editor) | Yes | Yes |
| [React Textarea Code Editor](#uiw-react-textarea-code-editor) | Yes | No |
| [CodeJar](#codejar) | No | Yes |
| [Yace](#yace) | No | No |
| [prism-code-editor](#prism-code-editor) | No | No |

## Libraries

### CodeMirror

[GitHub](https://github.com/codemirror/view) · [npm](https://www.npmjs.com/package/@codemirror/view) · [Docs](https://codemirror.net/examples/basic/)

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
- Capabilities: [From the CodeMirror docs](https://codemirror.net/examples/basic/)

**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.

**Watch out for**

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

```sh
npm install @codemirror/view@6.43.15 codemirror@6.0.2
```

**jupyterlab/jupyterlab** (15.4K stars)

[jupyterlab/jupyterlab](https://github.com/jupyterlab/jupyterlab) 

```javascript
revealSelection(
  selection: CodeEditor.IRange,
  options?: ScrollIntoViewOptions
): void {
  const start = this.getOffsetAt(selection.start);
  const end = this.getOffsetAt(selection.end);
  this._editor.dispatch({
    effects: EditorView.scrollIntoView(EditorSelection.range(start, end), {
      y: options?.block,
      x: options?.inline
    })
  });
}

```

[packages/codemirror/src/editor.ts](https://github.com/jupyterlab/jupyterlab/blob/d9277aeb24e864f96ce1fdbcb61ffd43bc34f29b/packages/codemirror/src/editor.ts) · [More projects using CodeMirror →](https://dashboard.exa.ai/playground/search?q=JavaScript%20TypeScript%20projects%20using%20%40codemirror/view%20for%20code%20editor%20model%20lifecycle%2C%20selection%20scrolling%2C%20markers%2C%20worker%20setup%20and%20content%20synchronization&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D)

**Quickstart**

```javascript
import { basicSetup } from 'codemirror';
import { EditorView } from '@codemirror/view';
new EditorView({ doc: 'Hello world', parent: document.body, extensions: [basicSetup] });

```

From [Basic setup example](https://codemirror.net/examples/basic/)

### Monaco Editor

[GitHub](https://github.com/microsoft/monaco-editor) · [npm](https://www.npmjs.com/package/monaco-editor) · [Docs](https://github.com/microsoft/monaco-editor/blob/main/docs/integrate-esm.md)

Provides the browser editor generated from Visual Studio Code sources.

- Downloads / mo: 51.9M
- Stars: 47.0K
- Last release: 0.57.0
- License: MIT
- Capabilities: [From the Monaco Editor docs](https://github.com/microsoft/monaco-editor/blob/main/docs/integrate-esm.md)

**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.

**Watch out for**

- **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.

```sh
npm install monaco-editor@0.57.0
```

**suren-atoyan/monaco-react** (4.8K stars)

[suren-atoyan/monaco-react](https://github.com/suren-atoyan/monaco-react) 

```javascript
function disposeEditor() {
  subscriptionRef.current?.dispose();

  if (keepCurrentModel) {
    saveViewState && viewStates.set(path, editorRef.current!.saveViewState());
  } else {
    editorRef.current!.getModel()?.dispose();
  }

  editorRef.current!.dispose();

  editorRef.current = null;
  preventCreation.current = false;
  setIsEditorReady(false);
}

```

[src/Editor/Editor.tsx](https://github.com/suren-atoyan/monaco-react/blob/f7ef2e686c83449babaea49815c69db3668d2ab7/src/Editor/Editor.tsx) · [More projects using Monaco Editor →](https://dashboard.exa.ai/playground/search?q=JavaScript%20TypeScript%20projects%20using%20monaco-editor%20for%20code%20editor%20model%20lifecycle%2C%20selection%20scrolling%2C%20markers%2C%20worker%20setup%20and%20content%20synchronization&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D)

**Quickstart**

```javascript
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' });

```

From [integrate-esm.md](https://github.com/microsoft/monaco-editor/blob/main/docs/integrate-esm.md)

### Ace

[GitHub](https://github.com/ajaxorg/ace-builds) · [npm](https://www.npmjs.com/package/ace-builds) · [Docs](https://ace.c9.io/#nav=howto)

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
- Capabilities: [From the Ace docs](https://ace.c9.io/#nav=howto)

**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.

**Watch out for**

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

```sh
npm install ace-builds@1.45.2
```

**securingsincity/react-ace** (4.2K stars)

[securingsincity/react-ace](https://github.com/securingsincity/react-ace) 

```javascript
public handleMarkers(markers: IMarker[]) {
  // remove foreground markers
  let currentMarkers = this.editor.getSession().getMarkers(true);
  for (const i in currentMarkers) {
    if (currentMarkers.hasOwnProperty(i)) {
      this.editor.getSession().removeMarker(currentMarkers[i].id);
    }
  }
  // remove background markers except active line marker and selected word marker
  currentMarkers = this.editor.getSession().getMarkers(false);
  for (const i in currentMarkers) {
    if (
      currentMarkers.hasOwnProperty(i) &&
      currentMarkers[i].clazz !== "ace_active-line" &&
      currentMarkers[i].clazz !== "ace_selected-word"
    ) {
      this.editor.getSession().removeMarker(currentMarkers[i].id);
    }
  }
  // add new markers
  markers.forEach(
    ({
      startRow,
      startCol,
      endRow,
      endCol,
      className,
      type,
      inFront = false
    }) => {
      const range = new Range(startRow, startCol, endRow, endCol);
      this.editor.getSession().addMarker(range, className, type, inFront);
    }
  );
}

```

[src/ace.tsx](https://github.com/securingsincity/react-ace/blob/334f49e2681ed5c2a84847b739d821d4b8df9534/src/ace.tsx) · [More projects using Ace →](https://dashboard.exa.ai/playground/search?q=JavaScript%20TypeScript%20projects%20using%20ace-builds%20for%20code%20editor%20model%20lifecycle%2C%20selection%20scrolling%2C%20markers%2C%20worker%20setup%20and%20content%20synchronization&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D)

**Quickstart**

```javascript
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' });

```

From [How-to guide](https://ace.c9.io/#nav=howto)

### react-simple-code-editor

[GitHub](https://github.com/react-simple-code-editor/react-simple-code-editor) · [npm](https://www.npmjs.com/package/react-simple-code-editor) · [Docs](https://cdn.jsdelivr.net/npm/react-simple-code-editor@0.14.1/README.md)

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
- Capabilities: [From the react-simple-code-editor docs](https://cdn.jsdelivr.net/npm/react-simple-code-editor@0.14.1/README.md)

**Strengths**

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

**Watch out for**

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

```sh
npm install react-simple-code-editor@0.14.1 react@19.2.0 react-dom@19.2.0 prismjs@1.30.0
```

**styleguidist/react-styleguidist** (11.0K stars)

[styleguidist/react-styleguidist](https://github.com/styleguidist/react-styleguidist) 

```tsx
public render() {
	return (
		<SimpleEditor
			className={this.props.classes.root}
			value={this.state.code}
			onValueChange={this.handleChange}
			highlight={highlight}
			// Padding should be passed via a prop (not CSS) for a proper
			// cursor position calculation
			padding={space[2]}
		/>
	);
}

```

[src/client/rsg-components/Editor/Editor.tsx](https://github.com/styleguidist/react-styleguidist/blob/c223f9a279f4e872cf6ff925fb21d2a7f6e27a77/src/client/rsg-components/Editor/Editor.tsx#L79-L91) · [More projects using react-simple-code-editor →](https://dashboard.exa.ai/playground/search?q=react-simple-code-editor%20GitHub%20projects)

**Quickstart**

```tsx
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 }} />;
}

```

From [README.md](https://cdn.jsdelivr.net/npm/react-simple-code-editor@0.14.1/README.md)

### React Textarea Code Editor

[GitHub](https://github.com/uiwjs/react-textarea-code-editor) · [npm](https://www.npmjs.com/package/@uiw/react-textarea-code-editor) · [Docs](https://cdn.jsdelivr.net/npm/@uiw/react-textarea-code-editor@3.1.3/README.md)

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
- Capabilities: [From the React Textarea Code Editor docs](https://cdn.jsdelivr.net/npm/@uiw/react-textarea-code-editor@3.1.3/README.md)

**Strengths**

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

**Watch out for**

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

```sh
npm install @uiw/react-textarea-code-editor@3.1.3 react@19.2.0 react-dom@19.2.0 less
```

**keycloak/keycloak** (38.0K stars)

[keycloak/keycloak](https://github.com/keycloak/keycloak) 

```tsx
const CodeEditor = ({
  onChange,
  height = 128,
  value,
  language,
  ...rest
}: CodeEditorProps) => {
  const codeEditor = useMemo(
    () => (
      <CodeEditorComponent
        padding={15}
        minHeight={height}
        style={{
          fontFamily:
            'ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace',
          fontSize: "16px",
        }}
        onChange={(event) => onChange?.(event.target.value)}
        value={value}
        language={language}
        {...rest}
      />
    ),
    [value, language],
  );

  return (
    <div style={{ height: `${height}px`, overflow: "auto" }}>{codeEditor}</div>
  );
};

```

[js/apps/admin-ui/src/components/form/CodeEditor.tsx](https://github.com/keycloak/keycloak/blob/7148a5e3ba19f62c15dc0c4be358d5123cdc51bf/js/apps/admin-ui/src/components/form/CodeEditor.tsx#L16-L45) · [More projects using React Textarea Code Editor →](https://dashboard.exa.ai/playground/search?q=%40uiw/react-textarea-code-editor%20GitHub%20projects)

**Quickstart**

```tsx
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)} />;
}

```

From [README.md](https://cdn.jsdelivr.net/npm/@uiw/react-textarea-code-editor@3.1.3/README.md)

### CodeJar

[GitHub](https://github.com/antonmedv/codejar) · [npm](https://www.npmjs.com/package/codejar) · [Docs](https://cdn.jsdelivr.net/npm/codejar@5.0.0/README.md)

Provides an embeddable browser code editor using a contenteditable host.

- Downloads / mo: 170.2K
- Stars: 2.0K
- Last release: 5.0.0
- License: MIT
- Capabilities: [From the CodeJar docs](https://cdn.jsdelivr.net/npm/codejar@5.0.0/README.md)

**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.

**Watch out for**

- **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.

```sh
npm install codejar@5.0.0 prismjs@1.30.0
```

**iximiuz/kexp** (935 stars)

[iximiuz/kexp](https://github.com/iximiuz/kexp) 

```javascript
() => {
  Prism.manual = true;

  // const highlight = (editor) => {
  //   editor.innerHTML = Prism.highlight(editor.textContent, Prism.languages.yaml, "yaml");
  //   Prism.highlightAll();
  // };
  jar = CodeJar(editor.value!, (elem) => Prism.highlightElement(elem), {
    tab: "  ",
  });
  jar.updateCode(props.code);

  jar.onUpdate((code) => {
    emit("codeChange", code);
  });

  if (!props.editable) {
    editor.value!.setAttribute("contenteditable", "false");
  }
}

```

[ui/src/components/CodeEditor.vue](https://github.com/iximiuz/kexp/blob/bb1bc8e532e1e26a32d135f453bdc0efddab0ef2/ui/src/components/CodeEditor.vue#L37-L56) · [More projects using CodeJar →](https://dashboard.exa.ai/playground/search?q=JavaScript%20TypeScript%20projects%20using%20codejar%20for%20code%20editor%20model%20lifecycle%2C%20selection%20scrolling%2C%20markers%2C%20worker%20setup%20and%20content%20synchronization&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D)

**Quickstart**

```javascript
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');
});

```

From [README.md](https://cdn.jsdelivr.net/npm/codejar@5.0.0/README.md)

### Yace

[GitHub](https://github.com/petersolopov/yace) · [npm](https://www.npmjs.com/package/yace) · [Docs](https://cdn.jsdelivr.net/npm/yace@1.1.1/README.md)

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
- Capabilities: [From the Yace docs](https://cdn.jsdelivr.net/npm/yace@1.1.1/README.md)

**Strengths**

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

**Watch out for**

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

```sh
npm install yace@1.1.1
```

**QuantumNous/new-api** (52.2K stars)

[QuantumNous/new-api](https://github.com/QuantumNous/new-api) 

```javascript
() => {
    const editor = editorRef.current
    if (!editor || editor.value === value) {
      return
    }

    editor.update({ value })
  }

```

[web/src/components/json-code-editor.tsx](https://github.com/QuantumNous/new-api/blob/3a407cc9b064fe79a4ffac4146b2690c465dc929/web/src/components/json-code-editor.tsx#L184-L191) · [More projects using Yace →](https://dashboard.exa.ai/playground/search?q=yace%20GitHub%20projects)

**Quickstart**

```javascript
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()] });

```

From [README.md](https://cdn.jsdelivr.net/npm/yace@1.1.1/README.md)

### prism-code-editor

[GitHub](https://github.com/jonpyt/prism-code-editor) · [npm](https://www.npmjs.com/package/prism-code-editor) · [Docs](https://cdn.jsdelivr.net/npm/prism-code-editor@5.4.0/readme.md)

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
- Capabilities: [From the prism-code-editor docs](https://cdn.jsdelivr.net/npm/prism-code-editor@5.4.0/readme.md)

**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.

```sh
npm install prism-code-editor@5.4.0
```

**springwolf/springwolf-core** (354 stars)

[springwolf/springwolf-core](https://github.com/springwolf/springwolf-core) 

```javascript
initEditor(): PrismEditor {
  const editor = createEditor(this.editorContainer.nativeElement, {
    value: this.code(),
    language: this.language(),
    lineNumbers: false,
    wordWrap: true,
    readOnly: this.readonly(),

    onUpdate: (code: string) => {
      this.code.set(code);
    },
  });
  editor.addExtensions(
    copyButton(),
    matchBrackets(true),
    highlightBracketPairs(),
    editHistory()
  );

  this.code.subscribe(() => {
    this.editor?.update();
  });

  return editor;
}

```

[springwolf-ui/src/app/components/code/prism-editor.component.ts](https://github.com/springwolf/springwolf-core/blob/ed0f1984d99c3f2827530ec0de1b5bdad412935a/springwolf-ui/src/app/components/code/prism-editor.component.ts#L58-L82) · [More projects using prism-code-editor →](https://dashboard.exa.ai/playground/search?q=prism-code-editor%20GitHub%20projects)

**Quickstart**

```javascript
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>' });

```

From [readme.md](https://cdn.jsdelivr.net/npm/prism-code-editor@5.4.0/readme.md)

## FAQ

### CodeMirror vs Monaco: which should I use?

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

### What is a good CodeMirror alternative?

[Monaco Editor](#monaco-editor) and [Ace](#ace) also provide full browser editors. For a small embed or a form field, [react-simple-code-editor](#react-simple-code-editor), [Yace](#yace), and [CodeJar](#codejar) highlight code over a plain editing surface.

### Which JavaScript code editor library has the most downloads?

[CodeMirror](#codemirror) has the most monthly downloads in this comparison, at 90.6M for its view package.

### Can Monaco workers start from a locally opened file?

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

### Does CodeMirror view include every editing feature?

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

### Does enabling Ace autocomplete require another file?

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

## How this page was built

Data checked Nov 20, 2026.

Reproduce it with the Exa API:

```json
{
  "endpoint": "/search",
  "body": {
    "query": "Best JavaScript code editor libraries Monaco CodeMirror Ace CodeJar examples",
    "numResults": 5
  }
}
```

Docs: https://exa.ai/docs/reference/search
