Jim Douglas is a down-on-his luck racing driver, reduced to competing in demolition derby races against drivers half his age. Jim lives in an old fire house overlooking San Francisco Bay with his friend and mechanic, Tennessee Steinmetz, a jolly Brooklynite who constantly extols the virtues of spiritual enlightenment, having spent time amongst Buddhist monks in Tibet, and builds 'art' from car parts. After yet another race ends in a crash (and Tennessee turns his Edsel into a sculpture), Jim finds himself without a car and heads into town in search of some cheap wheels. He is enticed into an upmarket European car showroom after setting eyes on an attractive sales assistant, Carole. Jim witnesses the dealership's British owner, Peter Thorndyke, being unneccessarily abusive towards a white Volkswagen Beetle that rolls into the showroom, and defends the car's honour, much to Thorndyke's displeasure. The following morning Jim is shocked to find that the Beetle is parked outside his house and that Thorndyke is pressing charges for theft. A heated argument between Jim and Thorndyke is settled when Carole persuades Thorndyke to drop the charges if Jim buys the car on a system of monthly payments.
Jim soon finds the car is prone to going completely out of his control and believes Thorndyke has conned him. Tennessee, however, believes certain inanimate objects to have hearts and minds of their own and tries to befriend the car, naming it Herbie. Jim's feelings about his new acquisition soon improve when it appears Herbie is intent on bringing him and Carole together. He also discovers Herbie to have an incredible turn of speed for a car of his size and decides to take him racing. After watching Jim and Herbie win their first race together, Thorndyke, himself a major force on the local racing scene, offers to cancel the remaining payments Jim owes on Herbie if Jim can win a race that they will both be competing in at Riverside later that month. Jim accepts, and despite Thorndyke's underhanded tactics, he and Herbie take victory. Over the next few months they go on to become the toast of the Californian racing circuit, while Thorndyke suffers increasingly humiliating defeats. Thorndyke finally snaps, and persuades Carole to take Jim out on a date while he sneaks round to Jim's house. After getting Tennessee drunk on his own Irish coffee recipe, Thorndyke proceeds to tip the remainder of the coffee into Herbie's engine. At the following day's race, an apparently drunk Herbie shudders to a halt while Thorndyke blasts to victory.
That evening Jim returns home in a brand new Lamborghini, having agreed to sell Herbie to Thorndyke in order to pay the remaining installments he owes on it. Jim states he needs a 'real car' for the upcoming El Dorado road race, but finds no sympathy from Tennessee, Carole, or Herbie, who proceeds to smash up the Lamborghini, proving to Jim once and for all he has a mind of his own. By the time Thorndyke arrives to collect Herbie, the Volkswagen is nowhere to be found, and Jim sets off into the night hoping to find Herbie and make amends before the car is seized by Thorndyke's goons. After narrowly escaping being torn apart in Thorndyke's workshop, and a destructive spree through Chinatown, Herbie is about to launch himself of the Golden Gate Bridge when Jim reaches him and talks him out of it. Herbie is impounded by the San Francisco Police Department, and Mr. Wu, a Chinese businessman whose store was damaged during Herbie's rampage, is demanding compensation that Jim can no longer afford. Using the Chinese he learnt while in Tibet, Tennessee tries to reason with Wu, and learns that he is a huge racing fan who knows all about Jim and Herbie's exploits. Wu is willing to drop the charges in exchange for becoming Herbie's new owner. Jim agrees to this, as long as Wu allows him to race the car in the El Dorado. If Jim wins, Wu will be able to keep the prize money but has to sell Herbie back for a dollar. Wu replies to this proposal in clear English: 'Now you speak my language!'.
The El Dorado runs through the Sierra Nevada mountains from Yosemite Valley and back. Before the start of the race, Thorndyke persuades Mr. Wu to make a wager with him on its outcome. Thorndyke (with his assistant Havershaw acting as co-driver) pulls every trick in the book to ensure he and his Thorndyke Special are leading at end of the first leg of the race. As a result of Thorndyke's shenanigans, Jim (with Carole and Tennessee as co-drivers) limps home last with Herbie missing three wheels and falling to pieces. Despite Tennessee's best efforts, it looks as if Herbie will be unable to start the return leg of the race the following morning. Thorndyke then arrives and claims that this makes him the new owner of the car. Wu regretfully tells Jim of the wager and that in accordance with its terms this is true. Suddenly, Herbie lurches into life and chases Thorndyke from the scene, showing he is more than ready to race on. Thanks to some ingenious shortcuts, Jim is able to make up for lost time in the second leg and is neck and neck with Thorndyke as the approach the finish line. In the tussle that ensues, Herbie's hastily welded-together body splits in two. The back half of the car (carrying Tennessee and the engine) crosses the line just ahead of Thorndyke, while the front (carrying Jim and Carole) rolls over the line just behind, meaning Herbie takes first and third place.
In accordance with the terms of the wager, Mr. Wu takes over Thorndyke's car dealership (hiring Tennessee as his assistant), while Thorndyke and Havershaw are relegated to lowly mechanics. Meanwhile, a fully repaired Herbie chauffeurs the newlywed Jim and Carole away on their honeymoon.