A feature-quantity extracting apparatus is provided, which can calculate a proper feature quantity, by performing a simple calculating operation. The apparatus is provided with a code-string acquiring unit for acquiring code strings for every given period from a series of input data, wherein the code string is an arrangement of codes and the code is given to a value of each piece of input data, a code-string pattern frequency counting unit for counting the number of code-string patterns for every code-string pattern among the code strings acquired by the code-string acquiring unit, wherein the code-string pattern represents a code-string whose codes are arranged in accordance with a given order, and a feature-quantity outputting unit for outputting the number of code-string patterns for every code-string pattern counted by the code-string pattern frequency counting unit as a feature quantity of the series of input data.