You’ll do anything to keep your child safe. You’ve babyproofed the house, surrounded your little one with age-appropriate toys, and taken measures to reduce the risk of accidents.

But your baby seems to have developed a habit of banging their head on items you can’t really avoid — walls, their crib, the floor, their hands. What now?

This is one aspect of child rearing that some parents don’t expect, but some children will repeatedly hit or bang their head against objects. This does include soft objects like a pillow or mattress. But sometimes, they take it a step further and bang away at hard surfaces.

This behavior is concerning. But try not to get too panicky, because it’s also within the realm of what’s normal. Here’s a look at common causes of head banging, as well as the best ways to respond to this behavior.

As odd as it may seem, head banging among babies and toddlers is actually a normal behavior. Some children do this around nap time or bedtime, almost as a self-soothing technique.

But despite being a common habit, it’s no less upsetting or frightening for you. It’s only natural to think the worst. Can head banging cause brain damage? Is it a sign of something serious? Can it cause other injury? Is my toddler angry?

Head banging can take different forms. Some children only bang their head when lying face down in the bed, and then repeatedly bang their head against the pillow or mattress.

Other times, though, babies or toddlers head bang while in an upright position. In this case, they might bang their head against a wall, crib railing, or the back of a chair.

Some children rock their body while banging their head, and others moan or make other noise.

The important thing to know, though, is that head banging isn’t usually anything to worry about, especially if it only occurs during nap time or bedtime.

The habit can start around the ages of 6 to 9 months, with many children getting over the habit by ages 3 to 5. Head banging episodes are relatively brief, lasting up to 15 minutes, although they might seem longer if you’re worried.

Understanding why a child bangs their head can help calm your nerves. Here are a couple possible explanations, with the first being much, much more common.

1. Sleep-related rhythmic movement disorder

Interestingly, this habit often occurs right before a child falls sleep. It may look painful, but in actuality, head banging is how some children soothe or calm themselves.

This is similar to how some children rock or shake their leg while going to sleep, or how some babies enjoy being rocked to sleep. To put it plainly, banging their head is a form of self-comfort, which most often leads to sleep. And for this reason, it’s not uncommon for some little ones to head bang to fall back asleep after waking up in the middle of the night.

Of course, the sudden sound of banging at night might startle you. But resist the urge to run in and rescue your child. As long as there’s no risk of injury and that’s the most important consideration here — let the banging play out. It’ll only last a few minutes, until your child goes back to sleep.

2. Developmental irregularities and disorders

Sometimes, though, head banging is a sign of a developmental condition like autism, or it might indicate psychological and neurological concerns.

To distinguish a rhythmic movement disorder from a developmental issue, observe when head banging occurs and the frequency.

As a general rule of thumb, if your child is healthy and doesn’t show signs of a developmental, psychological, or neurological condition — and banging only occurs before sleep — it’s likely a very typical rhythmic movement disorder.

On the other hand, if other symptoms accompany head banging — like speech delays, emotional outbursts, or poor social interaction — there could be another issue. See your pediatrician to rule out an underlying condition.

Although most head banging is normal and not indicative of a developmental problem, watching or hearing the banging can be nerve-racking. Rather than get frustrated, here are a few ways to respond.

1. Ignore it

Granted, this is easier said than done. Just know that if you respond frantically by picking up your little one or allowing them to sleep in your bed (which is never recommended for children up to 1 year), they might use the banging as a way to get attention and their way. If you ignore it, though, the behavior may only last a few minutes.

Only ignore the behavior if there is no risk of harm.

2. Re-position the crib

Even when a child isn’t at risk of injury, head banging can be loud and disrupt the rest of the household. One option is to move their bed away from the wall. This way, the headboard or crib doesn’t smack against the wall.

3. Prevent injury

If you’re concerned about your child injuring themselves, place cushions along the headboard. You can also install railings on a toddler bed to prevent your child from falling while head banging or rocking. These actions are only necessary if there’s the risk of injury.

Keep in mind that you should only place extra pillows in the beds of older children. The American Academy of Pediatrics states while your baby or toddler is still sleeping in a crib, they should do so without pillows, blankets, bumpers, and soft bedding to reduce the risk of sudden infant death syndrome (SIDS).

Observe when head banging occurs, and see a doctor if you suspect a developmental problem or other issues. This is more likely when head banging occurs throughout the day or when your child isn’t sleepy.

You should also see a doctor if you notice other symptoms like speech delays, poor head control, or clumsiness to rule out seizures. Your doctor can evaluate your child and make a diagnosis.

The bottom line is that head banging is a common habit that can start as early as 6 months old and continue up to age 5. (After that, it may not make an appearance again until your teen or 20-something attends their first metal concert.)

Understandably, repetitive movements like head banging can cause you concern. But in most cases, banging is simply your baby or child’s way of soothing themselves before falling asleep. So if your child is otherwise healthy, there’s probably nothing further for you to do other than keep them safe and wait it out.