401k withdrawal

Hello! How can I figure out if withdrawing $$ from my 401k early affect my taxes (i.e. will I end up having to pay taxes, instead of getting a refund)?