UtilitySansar
Văn bản

Whitespace & Indentation Cleaner

Clean up messy text or code in one paste. Strip trailing whitespace, collapse runs of blank lines, swap tabs for spaces (or vice versa), normalize CRLF/LF/CR line endings, and replace weird Unicode spaces with plain ASCII — with live before/after stats and toggleable rules so you only touch what you want.

Tóm tắt công cụ

Công cụ này nhận đầu vào có cấu trúc và trả về đầu ra xác định ngay trong trình duyệt, không tải lên máy chủ.

Tên công cụ
Whitespace & Indentation Cleaner
Mục đích đầu vào
Cung cấp nội dung nguồn để biến đổi, xác thực hoặc phân tích.
Mục đích đầu ra
Nhận đầu ra chuẩn hóa thuận tiện để sao chép, tái sử dụng hoặc gỡ lỗi.
Đầu vào ví dụ
function hello ( name ) { \tconsole.log( "hi " + name ); return true; }
Đầu ra ví dụ
function hello ( name ) { console.log( "hi " + name ); return true; }
Recent inputs0

Your last 5 inputs will appear here.

Spaces2927(-2)
Tabs11
Newlines75(-2)
Trailing-WS lines10(-1)
Blank lines42(-2)
  function   hello (  name  )   {
  	console.log(  "hi " +  name );

   return  true;
}

Giới thiệu công cụ

Clean up messy text or code in one paste. Strip trailing whitespace, collapse runs of blank lines, swap tabs for spaces (or vice versa), normalize CRLF/LF/CR line endings, and replace weird Unicode spaces with plain ASCII — with live before/after stats and toggleable rules so you only touch what you want.

Tổng quan công cụ

Whitespace bugs are the silent productivity drain — emails with double spaces, code reviews with mixed indentation, CSV exports with no-break spaces hiding in cells. This tool gives you a focused interface for the common cleanups: trim each side independently, collapse internal runs, drop or merge blank-line gaps, convert between tab and space indentation at any width, and rewrite line endings to LF, CRLF, or CR. Everything runs locally.

Trường hợp sử dụng

  • Normalize indentation when pasting code from a chat or browser
  • Strip trailing whitespace before committing to git
  • Convert CRLF line endings to LF for Linux build environments
  • Remove no-break spaces and other weird Unicode whitespace from CSV exports
  • Clean up email content with double spaces and inconsistent line breaks

Ví dụ đầu vào/đầu ra

Trailing trim + collapse blank lines + tabs→spaces + normalize Unicode spaces.
Mục đích đầu vào
  function   hello (  name  )   {
  \tconsole.log(  "hi " +  name );  


   return  true;
}
Mục đích đầu ra
function hello ( name ) {
  console.log( "hi " + name );

  return true;
}

Câu hỏi thường gặp

Will this corrupt strings inside code?+
Be careful with 'collapse internal spaces' and 'spaces to tabs' on code that has spaces inside strings or significant alignment — those run on every character including string contents. For most cleanups, trim and blank-line rules are safe.
What counts as a Unicode space?+
No-break space (U+00A0), em/en spaces, thin space, hair space, zero-width space, ideographic space, and similar — all the troublemakers that look like regular spaces but break grep, diff, and CSV parsing.
Why might I want CR or CRLF endings?+
CRLF is the Windows default and is required by some Windows-only tools and protocols. CR is the classic Mac OS 9 ending and rarely useful today. LF is the modern default for Linux, macOS, and most build tools.
Is my text uploaded?+
No. All processing runs in the browser.

Khám phá thêm công cụ

Khám phá các tiện ích liên quan trong danh mục Văn bản bên dưới.

Xem tất cả Văn bản

Công cụ liên quan

Tiện ích được tuyển chọn có thể hữu ích cho bạn