The original composition date or century for the Kamasutra is unknown. Historians have variously placed it between 400 BCE and 300 CE. According to John Keay, the Kama Sutra is a compendium that was collected into its present form in the 2nd century CE. In contrast, the Indologist Wendy Doniger who has co-translated Kama sutra and published many papers on related Hindu texts, the surviving version of the Kamasutra must have been revised or composed after 225 CE because it mentions the Abhiras and the Andhras dynasties that did not co-rule major regions of ancient India before that year. The text makes no mention of the Gupta Empire which ruled over major urban areas of ancient India, reshaping ancient Indian arts, Hindu culture and economy from the 4th-century through the 6th-century. For these reasons, she dates the Kama sutra to the second half of the 3rd-century CE.
The place of its composition is also unclear. The likely candidates are urban centers of north or northwest ancient India, alternatively in the eastern urban Pataliputra (now Patna).
Vatsyayana Mallanaga is its widely accepted author because his name is embedded in the colophon verse, but little is known about him. Vatsyayana states that he wrote the text after much meditation. In the preface, Vatsyayana acknowledges that he is distilling many ancient texts, but these have not survived. He cites the work of others he calls "teachers" and "scholars", and the longer texts by Auddalaki, Babhravya, Dattaka, Suvarnanabha, Ghotakamukha, Gonardiya, Gonikaputra, Charayana, and Kuchumara. Vatsyayana's Kamasutra is mentioned and some verses quoted in the Brihatsamhita of Varahamihira, as well as the poems of Kalidasa. This suggests he lived before the 5th-century CE.