30171 in words is written as :

Thirty Thousand One Hundred and Seventy One