Skip to main content

Use Prettier to format JavaScript/JSX, or Terser to minify JavaScript. Provides JSX examples, indented selection and direct action buttons, typing code will not run.

The input code is not executed. Compression retains variable names and does not perform logic optimization; permission comments will be retained as much as possible. Supports JavaScript/JSX, does not handle TypeScript.

75 / 100,000 characters

Shortcut key: Ctrl/⌘+Enter. Modifying inputs or options clears old results.

Instructions for use

  1. Paste JavaScript or JSX, choosing indentation.
  2. Click Direct Format; click Direct Compression when you need to compress JavaScript.
  3. Verify the results in the project's own test environment and then replace the original files.

Input and output examples

Example input
const add=(a,b)=>a+b;
Example output
const add = (a, b) => a + b;

Formatting does not change the intent of the code, but it does not replace logical testing beyond syntax.

FAQ

Current formatting supports JavaScript and JSX and does not handle TypeScript. The compressor targets JavaScript, and JSX should be converted by the project compiler first.

The compression here retains variable names and does not perform logical optimization; permission comments will be retained as much as possible. The input code will not be executed.

Calculation basis and reference materials

Use Prettier for formatting and Terser for compression; both parse code without performing input. Formatting supports JavaScript/JSX. JSX should be compiled into JavaScript before compression.

Content check: · About this site and content description

Related tools