Johann Sebastian Bach is arguably the greatest of all composers, with the St Matthew Passion and the Mass in B Minor among the most sublime masterpieces in classical music. But biographers over the past half century have "sanitised" his life, in the belief that only a saintly man could have written such heavenly music, according to one of the world's leading conductors and foremost interpreters of Bach.

After years of research, Sir John Eliot Gardiner says biographers have been so "overawed" by the composer that they have presented a misleading image of the man. They have depicted him as a "paragon of rectitude, studious and dull, with the false assumption that music of such extraordinary and sublime quality must have come from somebody who was beyond criticism".

Gardiner added: "The reality seems very different … You'd expect a more accurate and less rosy-tinted version of him."

Archival sources, including school inspector reports, reveal that Bach's education was troubled by gang warfare and bullying, sadism and sodomy – as well as his own extensive truancy.

His first school, Eisenach Latin school in Thuringia, Germany, was largely attended by the children of bourgeois tradespeople. However, Gardiner said that documents damn the boys as "rowdy, subversive, thuggish, beer- and wine-loving, girl-chasing … breaking windows and brandishing their daggers". He added: "More disquieting were rumours of a 'brutalisation of the boys' and evidence that many parents kept their children at home – not because they were sick, but for fear of what went on in or outside school." For punishment, Bach's contemporaries endured beatings and the threat of "eternal damnation". Such experiences must have left "lasting scars" on him, Gardiner believes.

Gardiner examined records in three schools Bach attended – Eisenach Latin, Ohrdruf Klosterschule and Michaelisschule, Lüneburg. "From the tone of the school reports, it sounds as if the authorities were really worried that the situation had got out of hand. There was something exceptional, certainly in Eisenach." A "villain of the piece", Gardiner discovered, was a form master and church cantor at Ohrdruf, where Bach was a chorister. The teacher was a sadistic disciplinarian meting out "intolerable punishments". He was eventually sacked as "the plague of the school, the scandal of the church and the cancer of the city", but the 12-year-old Bach had endured "unusually close exposure to him", Gardiner said.

Among Lüneburg's town records, he found reports on antisocial behaviour of two schoolboys in a local hostelry – "thoroughly drunk and … slashing … with [their] dirks and hunting knives". One is believed to have been Bach's mentor. Gardiner writes of sufficient evidence "to dent the traditional image of Bach as an exemplary youth … surviving unscathed the sinister goings-on in the schools he attended. It is just as credible that [he]… was in a line of delinquent school prefects – a reformed teenage thug." He added that Bach's repeated absences – 258 days in his first three years – are traditionally attributed to his mother's illness and his work in the family music business. But there could be a more sinister interpretation, he said, that the school conditions may have been so unappealing and even threatening.

Gardiner was "taken aback" to find that such archival evidence had initially been researched in the 1930s but "completely ignored and sanitised in biographies of Bach". He added: "It puzzled me why the standard biographies have just ignored that."

His research will be published by Penguin on 3 October in Music in the Castle of Heaven: A Portrait of Johann Sebastian Bach. Gardiner argues that Bach's compositions became a receptacle for the turbulence in his life, including the loss of his parents as a child and later his first wife and 12 of his 20 children before they had reached the age of three – "well beyond the average, even at a time when infant mortality was ubiquitous".

Although the impact on Bach of the violence and family losses is speculative, any insight into his early years is all the more significant as less is known about his private life than that of any other major composer of the last 400 years, says Gardiner. "We yearn to know what kind of a person was capable of composing music so complex that it leaves us completely mystified, then … so irresistibly rhythmic that we want to get up and dance to it, and then … so full of poignant emotion that we are moved to the very core of our being."