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

$currentPage = 'reverse-string';
$pageTitle = 'Reverse String Online - Free Text Reverser | Vivora Tools';
$pageDescription = 'Use this free reverse string tool to reverse text characters online instantly. Paste text or upload a .txt file, then copy the reversed output.';
$canonicalPath = 'reverse-string';
$bodyClass = 'tool-page reverse-string-page';
$breadcrumbs = [
    ['name' => 'Home', 'url' => ''],
    ['name' => 'Reverse String', 'url' => 'reverse-string'],
];
$structuredData = [
    [
        '@context' => 'https://schema.org',
        '@type' => 'WebApplication',
        'name' => 'Reverse String',
        'url' => site_url('reverse-string'),
        'description' => $pageDescription,
        'applicationCategory' => 'UtilitiesApplication',
        'operatingSystem' => 'Any',
        'offers' => [
            '@type' => 'Offer',
            'price' => '0',
            'priceCurrency' => 'USD',
        ],
        'featureList' => [
            'Reverse string online',
            'Reverse text characters instantly',
            'Text file upload',
            'Copy reversed output',
            'Reset text',
        ],
    ],
    [
        '@context' => 'https://schema.org',
        '@type' => 'FAQPage',
        'mainEntity' => [
            [
                '@type' => 'Question',
                'name' => 'What does this reverse string tool do?',
                'acceptedAnswer' => [
                    '@type' => 'Answer',
                    'text' => 'It reverses the order of characters in your input text and shows the reversed string instantly.',
                ],
            ],
            [
                '@type' => 'Question',
                'name' => 'Is this reverse string tool free?',
                'acceptedAnswer' => [
                    '@type' => 'Answer',
                    'text' => 'Yes. You can reverse text for free on Vivora Tools without creating an account.',
                ],
            ],
            [
                '@type' => 'Question',
                'name' => 'Can I upload a text file?',
                'acceptedAnswer' => [
                    '@type' => 'Answer',
                    'text' => 'Yes. You can upload a .txt file and the tool will place the file text into the input area before reversing it.',
                ],
            ],
            [
                '@type' => 'Question',
                'name' => 'Do you store the text I reverse?',
                'acceptedAnswer' => [
                    '@type' => 'Answer',
                    'text' => 'No. The reverse string conversion happens 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 reverse-string-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>Reverse String</span>
        </nav>
        <h1>Reverse String</h1>
        <p>
          Reverse a string online with a fast, free text reverser. Type, paste, or upload text to reverse every character instantly and copy the result in one click.
        </p>
      </div>
      <div class="tool-result" aria-live="polite">
        <span class="tool-result-label">Characters</span>
        <strong id="reverseStringLengthResult">0</strong>
        <span class="tool-result-unit">reversed</span>
      </div>
    </div>
  </div>
</section>

<main class="section pt-0">
  <div class="container">
    <section class="string-tool-shell reverse-string-tool-shell" data-reverse-string-tool>
      <div class="string-tool-toolbar" aria-label="Reverse string actions">
        <label class="icon-action upload-action" for="reverseStringFileInput" title="Upload .txt file">
          <i class="fa-solid fa-upload" aria-hidden="true"></i>
          <span>Upload .txt</span>
        </label>
        <input id="reverseStringFileInput" class="sr-only" type="file" accept=".txt,text/plain" />
        <button class="icon-action" type="button" id="copyReverseStringOutputButton" 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="resetReverseStringButton" 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="reverseStringInput">Input text</label>
          <textarea id="reverseStringInput" class="string-textarea" rows="12" placeholder="Paste text to reverse here..."></textarea>
          <div class="tool-meta-row">
            <span id="reverseStringToolStatus">Ready to reverse text.</span>
            <span><strong id="reverseStringInputCount">0</strong> input characters</span>
          </div>
        </div>

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

    <section class="tool-content-grid">
      <article>
        <h2>Reverse text online instantly</h2>
        <p>
          This free tool reverses the characters in your text as you type, paste, or upload a plain text file.
        </p>
      </article>
      <article>
        <h2>Copy the reversed string</h2>
        <p>
          Use it for quick formatting checks, coding examples, puzzles, test data, or any text workflow that needs reversed output.
        </p>
      </article>
    </section>

    <section class="tool-seo-panel" aria-labelledby="reverseStringGuideTitle">
      <div class="tool-seo-intro">
        <span class="tool-seo-kicker">Text reverser guide</span>
        <h2 id="reverseStringGuideTitle">How to use the Reverse String tool</h2>
        <p>
          Use this reverse text generator for coding examples, string testing, puzzles, mirrored text experiments, or quick formatting checks.
        </p>
      </div>

      <div class="tool-steps">
        <article>
          <span>1</span>
          <h3>Enter text</h3>
          <p>Paste your string, type into the input box, or upload a plain .txt file.</p>
        </article>
        <article>
          <span>2</span>
          <h3>Get reversed output</h3>
          <p>The tool reverses the character order immediately and shows the output beside your input.</p>
        </article>
        <article>
          <span>3</span>
          <h3>Copy the result</h3>
          <p>Use the copy button to copy the reversed string, or reset the tool to start again.</p>
        </article>
      </div>
    </section>

    <section class="tool-seo-panel" aria-labelledby="reverseStringFaqTitle">
      <div class="tool-seo-intro">
        <span class="tool-seo-kicker">FAQs</span>
        <h2 id="reverseStringFaqTitle">Reverse String FAQs</h2>
      </div>

      <div class="tool-faq-list">
        <article>
          <h3>What does this reverse string tool do?</h3>
          <p>It reverses the order of characters in your input text and shows the reversed string instantly.</p>
        </article>
        <article>
          <h3>Is this reverse string tool free?</h3>
          <p>Yes. Vivora Tools lets you reverse text online for free with no sign-up required.</p>
        </article>
        <article>
          <h3>Can I upload a text file?</h3>
          <p>Yes. Upload a .txt file and the tool will reverse the file content automatically.</p>
        </article>
        <article>
          <h3>Do you store the text I reverse?</h3>
          <p>No. The conversion runs in your browser, and Vivora Tools does not store your text.</p>
        </article>
      </div>
    </section>
  </div>
</main>

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