Code Cleaner User Guide
Code Cleaner, CSS and JavaScript tools

Green Macaroni User Guide

Code Cleaner

Give CSS and JavaScript a clearer working copy. Switch between two separate workspaces, format or minify, inspect the result and download a new file. Your code stays on your device.

CSS + JavaScriptLocal processingCopy · Download · Save session

Quick start

Two languages, one familiar workflow.

1Choose CSS or JavaScriptSwitch tabs at the top. Each tab remembers its own input, output, filename and settings.
2Paste or uploadPaste code into Input, choose Upload file, or drop a file anywhere. The file extension selects the matching tab.
3Inspect the outputFormatting runs after a short typing pause. Use Minify for compact output, or use Format to update manually.
4Keep a new copyCopy the output or download a new file. Your uploaded original is never overwritten.
Try Load example in each tab to explore without choosing a file. If input is already present, Undo replace brings it back.

CSS & JavaScript tabs

Switch freely without mixing the two languages.

Both tabs share a consistent layout and common controls. CSS-only controls disappear when JavaScript is selected. Each tab keeps its own comment, minify, inspection, audit and live-output settings.

Files ending in .css open in CSS. Files ending in .js, .mjs or .cjs open in JavaScript. Pasted code uses the currently selected tab; paste detection does not guess the language.

The app handles standalone stylesheets and JavaScript source. Extract code from HTML <style> or <script> tags before loading it. TypeScript and JSX are outside this app’s supported workflow.

Existing CSS Cleaner and JavaScript Cleaner addresses can open the matching Code Cleaner tab when the included redirect pages are installed.

Format, minify & comments

Useful defaults for a readable working copy.

ControlWhat it does
FormatCreates consistent indentation and spacing. It preserves CSS rule order and repeated declarations by default.
MinifyProduces compact output. JavaScript names are retained and compression optimizations are disabled. CSS structural whitespace is reduced while selector and value spacing is retained.
Keep commentsOn by default. Retains comments in formatted and minified output. Turn off to remove comment nodes. Check any license requirements before removing third-party notices.
Live outputAutomatically updates after about 260 ms without typing. Turn it off to control updates with Format or Ctrl/Cmd+Enter.

CSS section headers are temporarily skipped while Minify is on. Existing comments are still controlled by Keep comments. Output size can increase when formatting, keeping comments or adding annotations.

CSS tools

Headers, optional organization and focused inspection.

Add section headers

Adds readable comment headers before selector rules, including rules inside media queries. Choose Single line, Block or Underline. Header text is based on the selector; :root becomes GLOBAL SETTINGS. Keyframe steps are not annotated.

Organize & advanced

OptionBehavior
Merge repeated selectorsOff by default. Combines matching selector blocks within the same scope. Every declaration is retained, including fallbacks and !important values. Merging stops at comments, at-rules and nesting boundaries; media queries remain in place.
Reorder simple selectors by specificityOff by default. Sorts contiguous runs of simple selectors from lower to higher specificity. Functional pseudo-classes such as :is(), :not(), :where() and :has(), nesting, escaped selectors and namespaces are kept in place as boundaries.
Clean old headersOn by default. Removes recognized generated banners beginning with equals signs, [SELECTOR] or [GROUP], plus Code Cleaner audit comments, before adding new ones.
Legacy FIND tokensAdds [SELECTOR] and FIND markers to generated headers when Add section headers is on.
Merge and specificity ordering can change which CSS declaration wins. The app shows a reminder when either option is used. Keep the original and test the output on the actual page.

Formatting preserves the location of media queries, cascade layers, keyframes and other at-rules. Duplicate selectors are not merged unless you explicitly enable the merge option.

JavaScript tools

Readable scripts and optional import sorting.

Default formatting handles modern JavaScript syntax, modules, regular expressions and nested template strings through a syntax parser. It never runs your pasted script. Minification preserves variable and function names.

Sort imports

Off by default. Sorts eligible consecutive import declarations with external packages first, then relative imports, alphabetically within each group. Side-effect-only imports, comments and other statements act as boundaries.

Imported modules can have side effects even when they provide named exports. Sorting can change dependency evaluation order, so inspect and test the result before replacing a working script.

Color view, line numbers & audit

Inspect the result without changing the code.

Color-code view highlights output syntax. Line numbers adds a non-copying gutter in that color view. Wrap lines wraps long lines in the output, including the plain-text view. These controls do not alter the downloaded code.

Copy output copies raw source, without line numbers or highlight markup. Large output falls back to plain text to keep the interface responsive.

Audit

For CSS, Audit reports rules, repeated selectors and !important declarations, lists repeated properties that may be intentional fallbacks, and adds specificity comments for supported simple selectors. For JavaScript, it identifies console calls, debugger statements, and TODO/FIXME comments with input line numbers.

Expand Audit results below the editors. Audit is a focused inspection aid, not a complete linter, security audit or browser compatibility check.

Copy, download & replace

Keep useful filenames and recover a replaced input.

Copy output sends the latest processed code to the clipboard. If the browser blocks clipboard access, the app selects the plain output for manual copying. Copy, Swap and Download are disabled whenever the output is stale or processing fails.

Download creates a new file using the original basename, a clean/min label and a timestamp. JavaScript .mjs and .cjs extensions are retained for uploaded files; pasted JavaScript downloads as .js.

Swap to input replaces the input with its current output. Clear, Load example, uploading a file and Swap all keep the previous input available through Undo replace. This is one replacement step per tab; normal typing uses your browser’s native text undo.

Save, open & recover

Keep both workspaces together.

Save session downloads one JSON file containing both inputs, filenames, language selection and settings. Open session restores that file. The session is portable to another browser or device.

Drafts are also stored locally in sessionStorage for this browser tab. Reloading normally restores them. They are not intended to survive closing the tab, clearing browser data or a browser recovery failure. Browser session-restore features may retain closed-tab data longer, so use Forget drafts to clear it explicitly.

Forget drafts empties both tabs and clears their stored drafts and replacement history. Saved session files and downloaded code remain on your device. Download a session first if you want to keep your work.

Automatic recovery is best effort. If browser storage is full or unavailable, the footer advises using Save session. Output is regenerated from saved input rather than stored separately.

Keyboard & mobile

A usable workspace on large and small screens.

ActionShortcut / behavior
Process current inputCtrl+Enter on Windows; Cmd+Enter on Mac
Indent while editingTab inserts two spaces in the input
Switch tabs with keyboardFocus CSS or JavaScript, then use Left/Right; Home selects CSS, End selects JavaScript
Copy and undo typingUse standard browser/editor shortcuts
Mobile layoutInput and Output stack vertically. Buttons wrap; code areas scroll independently.

Privacy & performance

Local processing, with no sign-in or code upload.

Your code is read, parsed, formatted and highlighted on this device. It is never evaluated or sent to an external formatting service. The engines are included with the app; there are no runtime CDN, analytics or remote-font requests.

Local drafts and downloaded session files contain the source you entered. Treat them with the same care as the original code, especially if it contains credentials or other private information.

Automatic updates pause above 300,000 input characters. Use Format to process larger files explicitly. The input workspace limit is 5 MB per file, and processing stops after 20 seconds while keeping your input. Very long output uses the plain-text view.

Green Macaroni workflow

One home for the two former cleaner apps.

Code Cleaner combines CSS Cleaner and JavaScript Cleaner in one app. Use it after writing code by hand, generating a CSS system with Font Harmony Pro, or maintaining a website or WordPress stylesheet.

Copy or upload the code, inspect the cleaned result, download a new working copy and test it in its actual page or app. File handoffs are manual.

Troubleshooting

Keep the source, then check the setting or syntax.

Output did not change

Check Live output. Large files require Format even when Live output is checked. The status beside Output says when the result is up to date.

A parse error appears

Check the selected language and the reported input location. Use standalone CSS or JavaScript, without HTML tags. Output exports are disabled until the input processes successfully.

The processor cannot load

Upload the complete Code-Cleaner folder, including assets. Open it over a website or local web server; opening index.html directly from disk can prevent its worker from loading.

Styling or script behavior changed

Turn off CSS merge/specificity sorting or JavaScript import sorting. Compare the original and generated code, then test in the real page. The tool does not prove runtime equivalence or browser compatibility.

Clipboard, recovery or downloads are blocked

Use the manual copy fallback, save a session file, and check browser permissions. Code Cleaner never overwrites an uploaded file.

Back to Top