Any number of players may defend or attack at any time, except at penalty kicks (for defensive DFK fouls in the 18-yard box) and kicks from the penalty mark (tiebreaker used in tournaments requiring a clear winner). During those kicks, only the goalkeeper may defend, just as only one attacker may kick. Therefore, your answer is eleven during any time in the game other than PK or KftM.
Chat with our AI personalities
It depends on the formation. Many teams play a 4-4-2 formation, meaning there are 4 defenders, 4 midfielders, and 2 forwards, while others may play 3-4-3 (same order of numbers). In reality, the Laws of the Game do not specify how many defenders a team must field, or that there needs to be any at all. The only position that the Laws require is goalkeeper; everyone else is an outfield player, and the coaches (or captains) can decide where they will be, what they will be called, and what their job is.
In soccer there are usually 3 to 4 players in the defensive line (not including the goal-keeper). It just depends on the lineup that the particular team is playing.