For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /reference/string/reverseString.md.
Install massaman

reverseString es-toolkit

Reverses a string.

const reversed = reverseString(value);

Usage

reverseString(value)

Use reverseString when you want to reverse the order of characters in a string. It correctly handles Unicode characters and emojis.

import { reverseString } from 'es-toolkit/string';

// Basic string reversal
reverseString('hello'); // 'olleh'
reverseString('world'); // 'dlrow'

// Mixed case strings
reverseString('PascalCase'); // 'esaClacsaP'

// Strings with spaces
reverseString('hello world'); // 'dlrow olleh'

It accurately handles emojis and special characters.

import { reverseString } from 'es-toolkit/string';

// Strings with emojis
reverseString('foo πŸ˜„ bar'); // 'rab πŸ˜„ oof'
reverseString('μ•ˆλ…•ν•˜μ„Έμš”'); // 'μš”μ„Έν•˜λ…•μ•ˆ'

// Numbers and special characters
reverseString('12345'); // '54321'
reverseString('a-b-c'); // 'c-b-a'

Parameters

valuestringrequired

The string to reverse.

Returns

Returns a new string with the characters in reverse order.

string

Try It

::: sandpack

import { reverseString } from 'es-toolkit';

console.log(reverseString('hello'));

:::

Source: es-toolkit

Re-exported verbatim from es-toolkit. Implementation, edge cases, and performance behavior are owned upstream. This page mirrors the documentation at the pinned version; the linked source is authoritative.