Many casinos consider card counting not illegal, but it is frowned upon. Online casinos use software to shuffle the decks after each hand, making it impossible to count cards.