Per WIKI:
Measure how often a randomly chosen element from the set would be incorrectly labeled.

It's another way to measure impurity degree, alternative of Entropy.
Used in Decision tree learning algorithm - by the CART (classification and regression tree) algorithm.

Example

An example from revoledu:
Given that Prob (Bus) = 0.4, Prob (Car) = 0.3 and Prob (Train) = 0.3, we can now compute Gini index as

Gini Index = 1 – (0.4^2 + 0.3^2 + 0.3^2) = 0.660

Calculator

Input data: each line represent the probability/frequency of a group.