Whitespace Remover

Clean up text by removing extra whitespace and blank lines.

// about

About this Tool

Cleans up extra spaces, tab spaces, and empty blank lines from your text or code. It makes your document look neat and reduces unnecessary file size.

How to use it

  1. Paste your messy text with extra spaces.
  2. Choose options like 'Trim extra spaces' or 'Remove empty lines'.
  3. Click 'Run' and copy your clean text.

Why people use this tool

  • Removes duplicate spaces and extra blank lines in seconds.
  • Helps clean up copied text from websites or PDFs.
  • Makes code and data look clean without manual backspacing.

Frequently Asked Questions

Will this delete spaces between my normal words?

No, it only removes extra repeated spaces and leaves single spaces between words.

Can I use this for cleaning up code files?

Yes, it is great for removing empty lines and trailing spaces from code or notes.

Is there a limit on how much text I can paste?

You can paste large articles or data files with no problem!

Guides · Data · 7 min read

CSV vs JSON: When to Use Each and What to Watch When Converting

Sending a spreadsheet export to an API, or opening an API response in Excel, means converting between CSV and JSON. Knowing how the formats differ prevents data from being damaged along the way.

CSV (Comma-Separated Values) is a table. The first line holds column names and each following line is a row, with values separated by commas. It is the simplest, lightest way to store flat data in which every row has the same columns.

name,city,score
Kim,Seoul,92
Lee,Busan,85

[
  {"name": "Kim", "city": "Seoul", "score": 92},
  {"name": "Lee", "city": "Busan", "score": 85}
]
Structural differences between CSV and JSON, why Excel garbles UTF-8 CSV files, quoting rules for commas and quotes, and how to flatten nested data.
Read guide →
Build it with AI

Build this tool yourself with AI

Want your own version of this tool? Copy the work-order prompt into an AI chat, or save the skill file for an AI coding agent. Both describe the features, edge cases and test cases we used when building it.

AI work-order prompt

Paste it as-is into an AI chat such as Claude, ChatGPT or Gemini.

You are an experienced full-stack web developer. Build a web tool called "Whitespace Remover" that meets the requirements below.

## Goal

Build a tool that cleans up extra spaces, blank lines and line breaks in text.

## Core features

- Trim leading and trailing spaces
- Collapse repeated spaces
- Remove blank lines
- Join lines with spaces
- Handle tabs, non-breaking spaces and full-width spaces

## Inputs

- Text to clean
- Checkboxes for each rule

## Outputs

- Cleaned text
- Number of characters removed

## Edge cases and handling rules

- Option to preserve indentation for code
- Mixed CRLF and LF line endings
- Option to remove zero-width spaces (U+200B)
- Performance on very long text

## Implementation requirements

- Build it as a single page (HTML, CSS, JavaScript) that runs entirely in the browser, and never send the user's input to a server.
- Make the UI responsive and easy to use on mobile; label every input and keep everything keyboard accessible.
- Add a Copy button for results and show clear, friendly error messages for invalid input.
- Keep the core logic in functions separate from the UI so it can be unit-tested.

## Definition of done (test cases)

- '  a   b  ' becomes 'a b'
- Removing blank lines leaves none
- Non-breaking spaces become normal spaces

First outline your implementation plan in at most five lines, then write the complete code, and finally explain how to check the test cases above.

Skill (SKILL.md)

Save it as .claude/skills/build-whitespace-remover/SKILL.md for AI coding agents such as Claude Code to reuse whenever you build or change this tool.

---
name: build-whitespace-remover
description: Use when building or changing a Whitespace Remover tool. Build a tool that cleans up extra spaces, blank lines and line breaks in text.
---

# Build: Whitespace Remover

## Goal

Build a tool that cleans up extra spaces, blank lines and line breaks in text.

## Workflow

1. Review the required features, inputs and outputs below and ask about anything missing first.
2. Implement the core logic as pure functions separate from the UI.
3. Check the logic against the test cases in the verification list.
4. Build a responsive UI with an input form, a result area and a Copy button.
5. Reproduce each edge case listed under Rules and refine the error messages.

## Core features

- Trim leading and trailing spaces
- Collapse repeated spaces
- Remove blank lines
- Join lines with spaces
- Handle tabs, non-breaking spaces and full-width spaces

## Inputs

- Text to clean
- Checkboxes for each rule

## Outputs

- Cleaned text
- Number of characters removed

## Rules

- Option to preserve indentation for code
- Mixed CRLF and LF line endings
- Option to remove zero-width spaces (U+200B)
- Performance on very long text
- Build it as a single page (HTML, CSS, JavaScript) that runs entirely in the browser, and never send the user's input to a server.

## Verification

- [ ] '  a   b  ' becomes 'a b'
- [ ] Removing blank lines leaves none
- [ ] Non-breaking spaces become normal spaces

Tips for working with AI

  • Tell the AI your stack (for example React, Vue or plain HTML) on the first line so the code matches your project.
  • Ask it to run the listed test cases and show the results before you accept the code.
  • Never paste real secrets, customer data or API keys into the prompt; use sample values instead.