---
name: "iconv"
section: "1"
platform: "macos"
package: "libiconv"
version: "115.120.2"
release: "macOS 26.5"
platforms: ["linux", "freebsd", "macos"]
url: "https://new.carta.tech/iconv"
---

# iconv(1)

codeset conversion utility

## NAME

**iconv** – codeset conversion utility

## SYNOPSIS

**iconv** \[**-cs**\] **-f** *from\_name* **-t** *to\_name* \[*file* *...*\]

**iconv** **-f** *from\_name* \[**-cs**\] \[**-t** *to\_name*\] \[*file* *...*\]

**iconv** **-t** *to\_name* \[**-cs**\] \[**-f** *from\_name*\] \[*file* *...*\]

**iconv** **-l**

## DESCRIPTION

The **iconv** utility converts the codeset of *file* (or from standard input if no file is specified) from codeset *from\_name* to codeset *to\_name* and outputs the converted text on standard output.

The following options are available:

- **-c**

  Prevent output of any invalid characters. By default, **iconv** outputs an “invalid character” specified by the *to\_name* codeset when it encounts a character which is valid in the *from\_name* codeset but does not have a corresponding character in the *to\_name* codeset.

- **-f**

  Specifies the source codeset name as *from\_name*.

- **-l**

  Lists available codeset names. Note that not all combinations of *from\_name* and *to\_name* are valid.

- **-s**

  Silent. By default, **iconv** outputs the number of “invalid characters” to standard error if they exist. This option prevents this behaviour.

- **-t**

  Specifies the destination codeset name as *to\_name*.

## EXIT STATUS

The **iconv** utility exits 0 on success, and \>0 if an error occurs.

## EXAMPLES

Convert *file.txt* from IBM273 to UTF-8 and save the result to *converted.txt*:

```
iconv -f IBM273 -t UTF-8 file.txt > converted.txt
```

## SEE ALSO

[mkcsmapper(1)](/mkcsmapper/1.md), [mkesdb(1)](/mkesdb/1.md), [iconv(3)](/iconv/3.md)

## STANDARDS

**iconv** conform to IEEE Std 1003.1-2008 (“POSIX.1”).

## HISTORY

**iconv** first appeared in NetBSD 2.0, FreeBSD 9.0.
