I am finding conflicting information on the web...
Was it Book of Genesis or the Gilgamesh Epic that was written first?
Christianity Stack Exchange is a question and answer site for committed Christians, experts in Christianity and those interested in learning more. It only takes a minute to sign up.Sign up to join this community
The Epic of Gilgamesh was written before Genesis was written down but after the events of Genesis took place, and both were after the event of concern, the Flood of Noah (per your tag), occurred.
At least parts of the Epic of Gilgamesh were written by ~2100 BC, with the first complete version, the Akkadian version, dating from around 1300-1000 BC. See Wikipedia’s description of the history of the Epic of Gilgamesh. Genesis, along with the rest of the Pentateuch, in the timeframe of 1445-1405 BC. Related, the Sumerian flood story, the Atrahasis, dates to 1646–1626 BC.
Since you tagged the flood of Noah, I will say that the most important thing in discussing the account of Noah’s flood, however, is not comparing when the Bible was written with when these epics were written. The important thing is that all of these flood stories came after the actual event happened. Noah’s flood occurred around ~2300-2400 BC. See calculations from Answers in Genesis, Creation.com, and Bible Archeology (these are all probably YEC). It is well expected that many stories and myths, etc. would be written about this monumental, historical event as it was passed down orally before it was written down. So, the Epic of Gilgamesh, Atrahasis, and other flood stories can only serve to support (very indirectly) the account given in Scripture that God sent a worldwide flood to destroy the Earth as judgment.
You can also see the question Are other flood legends relevant to Christians? for more discussion.
History on the net dates the epic of Gilgamesh to 1300 to 1000 B.C. https://www.historyonthenet.com/the-epic-of-gilgamesh
Those that advocate a 1445 B.C. date do it on the basis of internal evidence from Scripture. 1 Kings 6:1 tells us that Solomon built the Temple in the fourth year of his reign over Israel.
And it came to pass in the four hundred and eightieth year after the children of Israel had come out of the land of Egypt, in the fourth year of Solomon's reign over Israel, in the month of Ziv, which is the second month, that he began to build the house of the Lord (1 Kings 6:1).
The fourth year of Solomon's reign was about 966 B.C. and 480 years before that would give us the date of approximately 1445 B.C.