It typically reduces filesize by half, resulting in faster downloads. It also encourages a more expressive programming style because it eliminates the download cost of clean, literate self-documentation.
JSMin is a filter that omits or modifies some characters. This does not change the behavior of the program that it is minifying. The result may be harder to debug. It will definitely be harder to read.
JSMin first replaces carriage returns ('') with linefeeds (''). It replaces all other control characters (including tab) with spaces. It replaces comments in the // form with linefeeds. It replaces comments in the /* */ form with spaces. All runs of spaces are replaced with a single space. All runs of linefeeds are replaced with a single linefeed.
It omits spaces except when a space is preceded or followed by a non-ASCII character or by an ASCII letter or digit, or by one of these characters:
$ _
It is more conservative in omitting linefeeds, because linefeeds are sometimes treated as semicolons. A linefeed is not omitted if it precedes a non-ASCII character or an ASCII letter or digit or one of these characters:
$ _ { [ ( -
and if it follows a non-ASCII character or an ASCII letter or digit or one of these characters:
$ _ } ] ) - " '
No other characters are omitted or modified.
JSMin knows to not modify quoted strings and regular expression literals.
JSMin does not obfuscate code, but does make it un-readable.
The tool is available in multiple programming languages.