<?php
require_once __DIR__ . '/includes/config.php';

$currentPage = 'remove-whitespace';
$pageTitle = 'Remove Whitespace Online - Delete Spaces, Tabs, Line Breaks | Vivora Tools';
$pageDescription = 'Use this free remove whitespace tool to delete spaces, tabs, and line breaks from text instantly. Paste text or upload a .txt file.';
$canonicalPath = 'remove-whitespace';
$bodyClass = 'tool-page remove-whitespace-page';
$breadcrumbs = [
    ['name' => 'Home', 'url' => ''],
    ['name' => 'Remove Whitespace', 'url' => 'remove-whitespace'],
];
$structuredData = [
    [
        '@context' => 'https://schema.org',
        '@type' => 'WebApplication',
        'name' => 'Remove Whitespace',
        'url' => site_url('remove-whitespace'),
        'description' => $pageDescription,
        'applicationCategory' => 'UtilitiesApplication',
        'operatingSystem' => 'Any',
        'offers' => [
            '@type' => 'Offer',
            'price' => '0',
            'priceCurrency' => 'USD',
        ],
        'featureList' => [
            'Remove whitespace online',
            'Remove all spaces',
            'Remove tabs',
            'Remove line breaks',
            'Text file upload',
            'Copy cleaned output',
            'Reset text',
        ],
    ],
    [
        '@context' => 'https://schema.org',
        '@type' => 'FAQPage',
        'mainEntity' => [
            [
                '@type' => 'Question',
                'name' => 'What whitespace does this tool remove?',
                'acceptedAnswer' => [
                    '@type' => 'Answer',
                    'text' => 'It removes all whitespace characters, including spaces, tabs, and line breaks.',
                ],
            ],
            [
                '@type' => 'Question',
                'name' => 'Does it remove line breaks too?',
                'acceptedAnswer' => [
                    '@type' => 'Answer',
                    'text' => 'Yes. This tool removes spaces, tabs, line breaks, and other whitespace characters.',
                ],
            ],
            [
                '@type' => 'Question',
                'name' => 'Can I upload a text file?',
                'acceptedAnswer' => [
                    '@type' => 'Answer',
                    'text' => 'Yes. Upload a .txt file and the tool will place the file content in the input area and show the whitespace-free output automatically.',
                ],
            ],
            [
                '@type' => 'Question',
                'name' => 'Do you store the text I clean?',
                'acceptedAnswer' => [
                    '@type' => 'Answer',
                    'text' => 'No. Whitespace removal runs in your browser, and Vivora Tools does not store your input or output text.',
                ],
            ],
        ],
    ],
];
require __DIR__ . '/includes/head.php';
require __DIR__ . '/includes/header.php';
?>

<section class="tool-hero whitespace-tool-hero">
  <div class="container">
    <div class="tool-hero-grid">
      <div>
        <nav class="tool-breadcrumb" aria-label="Breadcrumb">
          <a href="/">Home</a>
          <span>/</span>
          <span>Remove Whitespace</span>
        </nav>
        <h1>Remove Whitespace</h1>
        <p>
          Remove whitespace online from any text. Type, paste, or upload text to delete spaces, tabs, line breaks, and other whitespace characters instantly.
        </p>
      </div>
      <div class="tool-result" aria-live="polite">
        <span class="tool-result-label">Removed</span>
        <strong id="whitespaceRemovedResult">0</strong>
        <span class="tool-result-unit">characters</span>
      </div>
    </div>
  </div>
</section>

<main class="section pt-0">
  <div class="container">
    <section class="string-tool-shell whitespace-tool-shell" data-remove-whitespace-tool>
      <div class="string-tool-toolbar" aria-label="Remove whitespace actions">
        <label class="icon-action upload-action" for="whitespaceFileInput" title="Upload .txt file">
          <i class="fa-solid fa-upload" aria-hidden="true"></i>
          <span>Upload .txt</span>
        </label>
        <input id="whitespaceFileInput" class="sr-only" type="file" accept=".txt,text/plain" />
        <button class="icon-action" type="button" id="copyWhitespaceOutputButton" title="Copy output">
          <i class="fa-solid fa-copy" aria-hidden="true"></i>
          <span>Copy</span>
        </button>
        <button class="icon-action danger" type="button" id="resetWhitespaceButton" title="Reset text">
          <i class="fa-solid fa-rotate-left" aria-hidden="true"></i>
          <span>Reset</span>
        </button>
      </div>

      <div class="dual-textarea-layout">
        <div class="string-input-panel">
          <label class="tool-label" for="whitespaceInput">Input text</label>
          <textarea id="whitespaceInput" class="string-textarea" rows="12" placeholder="Paste text with whitespace here..."></textarea>
          <div class="tool-meta-row">
            <span id="whitespaceToolStatus">Ready to remove whitespace.</span>
            <span><strong id="whitespaceInputLength">0</strong> input characters</span>
          </div>
        </div>

        <div class="string-input-panel output-panel">
          <label class="tool-label" for="whitespaceOutput">Output text</label>
          <textarea id="whitespaceOutput" class="string-textarea output-textarea" rows="12" placeholder="Whitespace-free output will appear here..." readonly></textarea>
          <div class="tool-meta-row">
            <span>Cleaned text</span>
            <span><strong id="whitespaceOutputLength">0</strong> output characters</span>
          </div>
        </div>
      </div>
    </section>

    <section class="tool-content-grid">
      <article>
        <h2>Remove all whitespace online</h2>
        <p>
          This free tool deletes every whitespace character from text, making it useful for compact strings, identifiers, copied data, and quick text cleanup.
        </p>
      </article>
      <article>
        <h2>Spaces, tabs, and line breaks</h2>
        <p>
          The output removes all whitespace with one pass, including normal spaces, repeated spaces, tabs, and new lines.
        </p>
      </article>
    </section>

    <section class="tool-seo-panel" aria-labelledby="whitespaceGuideTitle">
      <div class="tool-seo-intro">
        <span class="tool-seo-kicker">Whitespace remover guide</span>
        <h2 id="whitespaceGuideTitle">How to use Remove Whitespace</h2>
        <p>
          Use this whitespace remover when you need a compact string with no spaces, tabs, or line breaks for identifiers, copied data, testing, or formatting cleanup.
        </p>
      </div>

      <div class="tool-steps">
        <article>
          <span>1</span>
          <h3>Paste or upload text</h3>
          <p>Add text manually or upload a plain .txt file that contains spaces, tabs, or line breaks.</p>
        </article>
        <article>
          <span>2</span>
          <h3>Remove whitespace</h3>
          <p>The tool deletes all whitespace characters and shows a compact output immediately.</p>
        </article>
        <article>
          <span>3</span>
          <h3>Copy the output</h3>
          <p>Copy the whitespace-free result, or reset the page to clean another text sample.</p>
        </article>
      </div>
    </section>

    <section class="tool-seo-panel" aria-labelledby="whitespaceFaqTitle">
      <div class="tool-seo-intro">
        <span class="tool-seo-kicker">FAQs</span>
        <h2 id="whitespaceFaqTitle">Remove Whitespace FAQs</h2>
      </div>

      <div class="tool-faq-list">
        <article>
          <h3>What whitespace does this tool remove?</h3>
          <p>It removes all whitespace characters, including spaces, tabs, and line breaks.</p>
        </article>
        <article>
          <h3>Does it remove line breaks too?</h3>
          <p>Yes. Line breaks are removed along with spaces, tabs, and other whitespace.</p>
        </article>
        <article>
          <h3>Can I upload a text file?</h3>
          <p>Yes. Upload a .txt file and the whitespace-free output will be generated automatically.</p>
        </article>
        <article>
          <h3>Do you store the text I clean?</h3>
          <p>No. The cleanup runs in your browser, and Vivora Tools does not store your text.</p>
        </article>
      </div>
    </section>
  </div>
</main>

<?php require __DIR__ . '/includes/footer.php'; ?>
