The first eighteen verses of John are called the “Prologue”. They are written differently from the rest of the book which is narrative.
Let's see how NLT formats the opening verses of John:
The first 5 verses are set as a poem or hymn. After that, it breaks into a rhythmic prose. After verse 18, it is just plain narrative.
John, CHAPTER 1:
Let's see how NLT formats the opening verses of John:

The first 5 verses are set as a poem or hymn. After that, it breaks into a rhythmic prose. After verse 18, it is just plain narrative.
John, CHAPTER 1:
[1:1–18] The prologue states the main themes of the gospel: life, light, truth, the world, testimony, and the preexistence of Jesus Christ, the incarnate Logos, who reveals God the Father. In origin, it was probably an early Christian hymn. Its closest parallel is in other christological hymns, Col 1:15–20 and Phil 2:6–11. Its core (Jn 1:1–5, 10–11, 14) is poetic in structure, with short phrases linked by “staircase parallelism,” in which the last word of one phrase becomes the first word of the next. Prose inserts (at least Jn 1:6–8, 15) deal with John the Baptist.