Is God masculine, feminine, or both?

There is nowadays a widespread discussion going on concerning this question.
From the fact that ancient religions often also have female deities we may conclude that it is not from today or yesterday that mankind is wrestling with the question how to interpret these characteristics of God.
To protect ourselves against 'creating a God according to our image', we have to consider that God in his person, characteristics, and attributes, being the Creator, the Highest One, the Almighty One, will absolutely not change of personality as a result of our opinions.
In other words, should we stand on our heads for three days, He will not change. He is the same, yesterday, today, and forever.
Therefore, before we put up such a question, we first have to discover our motives concerning the outcome if we can find one. Now let’s talk straight and without masks. To be more specific you may ask yourselves the question: for what reason do I want the answer more likely to be this or that? Do you hate man, or do you hate the idea that God should be a she? Did you have a tyrannical father or a mean mother? Were you abused during your childhood by an uncle or an aunt, brother or sister? If so, then this question is not your problem but the psychological and emotional harm that was done to you is. Then you first have to seek inner healing of your past and to find new life in Jesus Christ to get into the right attitude and position to discover who God really is.

Meanwhile we go on with the technical side of this question to find a satisfactory answer.
Let’s have a look to the very first verses in the Bible, in Genesis 1.
There is spoken of God as elohim which is a plural word. May we conclude from this plurality that there are more gods than only one and that there was for example a female god involved? Not exactly so. That the word elohim is plural does not prove that there were more gods. It may however indicate the plurality of God in His being and it could be an early indication of the Trinity of God's being. We may also consider the word elohim as a way of speaking in the same way as we use the expression 'we the Queen of England'. The word elohim was just a general expression in that time to point to the Godhead or to gods. No, what is really interesting is the context of the Scripture. You have to know that the Hebrew words can only rightly be defined and translated if we know the context. In this case also the word elohim stands not on its own but like this: bereshith bara elohim. The word bara here is a verb connected with the word elohim. This word bara first means: to create. Furthermore, the conjugation shows us that it is a singular word, and also that it is a third person male conjugation. If we translate this literally we would rightfully see the outcome as: He, God(s) created ....
In addition to this we may mention the fact that the word elohim also is a male word. This is evident from the plural attribute im, which is the male extension.

Now let’s go to the next verse where it says
"And the Spirit of God was hovering ..."
In the Hebrew it is like this:
weruach elohim merachefet.
Again, in translating correctly we have to define the words in their conjunction. Words of the elements in nature like earth, fire, stone, are female words. The word ruach appears in both forms.
Now the word ruach on its own can have several meanings and is often translated as wind.
In this case however it is not just 'wind', no, it is ruach elohim: wind (of) God(s). Therefore we know that it has to be translated as Spirit, but breath would also be a good option in this case.
Here you see that by the conjunction actually the real meaning of the word is determined. But not only the meaning, also whether it has to be considered masculine or feminine. In this case the verb merachefet let us know that ruach in this sentence is considered feminine, as ‘wind’ often is. However, the fact that it stands not on its own but is used to indicate something of a Person, it is this personality by which we actually have to decide how to interpret the sentence.
And since it is evident that elohim is a masculine expression, we rightfully interpret the Spirit of God to be addressed as masculine.

But we are not satisfied with only these few indications in Scripture. Therefore we will do some more searching and have a look to 1 Kings 22:24. Here it says:
"Which way did the Spirit from the Lord go from me ...?"
In this case we see the conjunction of 'did go' and 'Spirit': aavar ruach jhwh.
Not only do we see here the use of the name of God, JaHWeH, I am who I am, which always appears in conjunction with masculine verbs, but also the word for 'did go', aavar, is a masculine verb, indicating the masculinity of the Spirit of God.

If you are still doubting, then consider the virgin birth of Jesus Christ, which is a very important miraculous fact in history. Without the acceptance of the virgin birth, your faith is worthless. Now think of this: Can you imagine Jesus Christ procreated by the Spirit of God when this Spirit has to be considered feminine?

It is obvious from these conclusions how God sees himself. He sees himself exactly how He speaks of himself. "But wait a minute" somebody might say, "the Bible is written by man, isn’t it? So therefore these writers may have written according to their own interpretation?"
Wrong! You are not dealing with just mere man's writings, but with the thoughts of the Almighty God who inspired chosen vessels who were 'driven' by the holy Spirit to speak and to write. The apostle Paul wrote it down in this valuable statement, in 2 Timothy 3:16:
"All Scripture is given by inspiration of God, and is profitable for doctrine,
for reproof, for correction, for instruction in righteousness."

This means that God himself has put his stamp on all the masculine verbs and presents himself masculine through all Scripture, while Scripture itself is acknowledged by the Lord Jesus Christ when He mentioned it or quoted from it from Genesis to Malachi. (Luke 24:17).

But .......
We do not only have to look the grammatical and technical aspects of these things, but also to the spiritual and theological aspects. For the Bible teaches us that in the beginning God created man in his own image, male and female created He them. Genesis 1:27.
It is almost unthinkable that there are aspects in human beings that have not their origin in God, except evil. We are also taught in Scripture that God made the woman out of the man. Genesis 2:22. This is a great spiritual secret and mystery. For also the Church of Jesus Christ is created from Him (Jesus) as the female part besides Him. For this reason, marriage has its origin in God and is therefore godly and sacred.
According to these facts we may conclude that although God presents himself masculine, there are feminine aspects in his being. In Isaiah 66:13 God says:
"As one whom his mother comforts, so I will comfort you."
But He also said that He bore his people in the desert like a man bears his son. Deuteronomy 1:31. And in the New Testament we heard Jesus say:
"How often I wanted to gather your children together,
as a hen gathers her chicks under her wings."

(Matthew 23:37).
The best way to describe God according to the aspects we are talking about is perhaps to conclude that He is 'complete', and that He wanted to reflect that completeness into the oneness of man and woman.
However, undeniable He presents himself masculine for which reason we close this question with 2 Corinthians 1:3:
Blessed be the God and Father of our Lord Jesus Christ,
the Father of mercies and God of all comfort.