Humping (also called mounting) is a normal and instinctive behaviour in dogs. Both male and female dogs may hump at different times in their lives, and it does not always mean the behaviour is sexual.
Dogs may mount other dogs, people, toys, blankets or furniture. In many cases it is simply a response to excitement, stress, or play, rather than mating behaviour.

Because humping is natural for dogs, punishment is not recommended. Punishing a dog for mounting can increase stress and confusion and may make the behaviour worse.
If the behaviour is occasional and not causing problems, it may not need intervention. However, if it happens frequently or causes issues, there are steps that may help.
Dogs with excess energy may hump more often. Ensuring your dog receives enough daily exercise, play and mental stimulation can help reduce the behaviour.
If your dog begins to hump, calmly interrupt the behaviour and redirect them to another activity. For example:
If the behaviour continues, briefly removing your dog from the situation can help them calm down.
Pay attention to situations where the behaviour occurs. If humping happens when your dog becomes overstimulated during play or when guests arrive, helping your dog stay calm during these situations can reduce the behaviour.
Proper socialisation helps dogs learn appropriate play behaviour and communication with other dogs.
If the behaviour is driven by hormones, neutering may reduce mounting behaviour, particularly in male dogs. However, neutering does not always eliminate humping entirely, especially if it has become a learned habit.
You should speak to your vet if:
Your vet can check for possible medical causes and may recommend support from a qualified dog behaviourist if needed.