svgo - Man Page

svgo – nodejs-based tool for optimizing SVG vector graphics files

Examples (TL;DR)


svgo [options] [INPUT...]




Alias to --input



output the version number

-i--input <INPUT...>

Input files, ”-“ for STDIN

-s--string <STRING>

Input SVG data string

-f--folder <FOLDER>

Input folder, optimize and rewrite all *.svg files

-o--output <OUTPUT...>

Output file or folder (by default the same as the input), ”-“ for STDOUT

-p--precision <INTEGER>

Set number of digits in the fractional part, overrides plugins params

--config <CONFIG>

Custom config file, only .js is supported

--datauri <FORMAT>

Output as Data URI string (base64), URI encoded (enc) or unencoded (unenc)


Pass over SVGs multiple times to ensure all optimizations are applied


Make SVG pretty printed

--indent <INTEGER>

Indent number when pretty printing SVGs

--eol <EOL>

Line break to use when outputting SVG: lfcrlf. If unspecified, uses platform default.


Ensure SVG ends with a line break


Use with --folder. Optimizes *.svg files in folders recursively.

--exclude <PATTERN...>

Use with --folder. Exclude files matching regular expression pattern.


Only output error messages, not regular status messages


Show available plugins and exit


Output plain text without color


Display help for command


October 2021