Blaspheming the Holy Spirit means denying the power of God and is mentioned by Jesus in connection with the unpardonable sin. It is not something that a person can say or do in a moment by accident or ignorance. Rather, blaspheming the Holy Spirit is a mindset that is firmly set against God and unwilling to acknowledge Him even when one knows that they should.
The phrase "blaspheme the Holy Spirit" is found only in Matthew 12:31-32 Matthew 12:31-32  Why I say to you, All manner of sin and blasphemy shall be forgiven to men: but the blasphemy against the Holy Ghost shall not be forgiven to men.
 And whoever speaks a word against the Son of man, it shall be forgiven him: but whoever speaks against the Holy Ghost, it shall not be forgiven him, neither in this world, neither in the world to come.
American King James Version×, Mark 3:28-29 Mark 3:28-29  Truly I say to you, All sins shall be forgiven to the sons of men, and blasphemies with which soever they shall blaspheme:  But he that shall blaspheme against the Holy Ghost has never forgiveness, but is in danger of eternal damnation.
American King James Version× and Luke 12:8-10 Luke 12:8-10  Also I say to you, Whoever shall confess me before men, him shall the Son of man also confess before the angels of God:  But he that denies me before men shall be denied before the angels of God.  And whoever shall speak a word against the Son of man, it shall be forgiven him: but to him that blasphemes against the Holy Ghost it shall not be forgiven.
American King James Version×, and all three of these passages convey the same teaching by Jesus Christ. In this article, we will examine the meaning of this phrase in more detail. For more information about how blaspheming the Holy Spirit can become the unpardonable sin, please see What is the unpardonable sin? What sin won't God forgive?
The word "blaspheme" comes directly from the Greek blasphemia, which most nearly means "evil speaking." This Greek word can actually refer to any kind of profane words or sinful use of language, but when directed toward God in the New Testament it most nearly means to deny the power and authority of God. Notice how this understanding fits with Jesus' introductory comment just before He discusses blaspheming the Holy Spirit in Luke 12:8-9 Luke 12:8-9  Also I say to you, Whoever shall confess me before men, him shall the Son of man also confess before the angels of God:
 But he that denies me before men shall be denied before the angels of God.
American King James Version×: "Whoever confesses Me before men, him the Son of Man will also confess before the angels of God. But he who denies Me before men will be denied before the angels of God."
Jesus states clearly that those who deny Him before men—that is, who deny His identity as the Son of God and the position of rulership accompanying that status—will also be denied before God the Father (see also Matthew 10:33 Matthew 10:33But whoever shall deny me before men, him will I also deny before my Father which is in heaven.
American King James Version×). In other words, a person who refuses to accept Jesus will eventually be condemned if they do not repent. The same thought is simply repeated in the next verse:
"And anyone who speaks a word against the Son of Man, it will be forgiven him; but to him who blasphemes against the Holy Spirit, it will not be forgiven" (Luke 12:10 Luke 12:10And whoever shall speak a word against the Son of man, it shall be forgiven him: but to him that blasphemes against the Holy Ghost it shall not be forgiven.
American King James Version×).
The Holy Spirit is the power and essence of God, not a separate entity or person that must somehow be held in higher esteem than Jesus Christ (for more clarification, see Is the Holy Spirit a Person?). Therefore, this verse is best understood as a restatement of the reality Jesus had just pointed out: "Blaspheming the Holy Spirit" means to deny the power of the true God and salvation through His Son, the Lord Jesus Christ. But why then does it make a distinction that speaking against the Son of Man will be forgiven while blasphemy against the Spirit will not?
There were many Pharisees who “spoke against the Son of Man” while He was there with them in the flesh because they did not truly understand who He was. Later, when they were convinced by the apostles that Jesus was the Messiah and Son of God, many of these repented and were indeed forgiven!
This is evident from Peter's moving sermon in Acts 2:36-38 Acts 2:36-38  Therefore let all the house of Israel know assuredly, that God has made the same Jesus, whom you have crucified, both Lord and Christ.
 Now when they heard this, they were pricked in their heart, and said to Peter and to the rest of the apostles, Men and brothers, what shall we do?
 Then Peter said to them, Repent, and be baptized every one of you in the name of Jesus Christ for the remission of sins, and you shall receive the gift of the Holy Ghost.
American King James Version×, where he urges those who demanded Jesus' death to open their eyes and realize that Jesus actually was the Son of God as He claimed to be so that they could repent and receive forgiveness. Until they recognized that Jesus was in fact the Messiah sent from God, they could be forgiven for not believing in Him. By contrast, God holds people accountable for blaspheming the Holy Spirit if they continue to reject Jesus even after recognizing that He is the Son of God.
This difference in accountability based on one's knowledge explains why both Luke 12:9 Luke 12:9But he that denies me before men shall be denied before the angels of God.
American King James Version×and Matthew 10:33 Matthew 10:33But whoever shall deny me before men, him will I also deny before my Father which is in heaven.
American King James Version×state that denying Christ will result in being denied before God, which might appear to contradict being forgiven for speaking against Jesus in Luke 12:10 Luke 12:10And whoever shall speak a word against the Son of man, it shall be forgiven him: but to him that blasphemes against the Holy Ghost it shall not be forgiven.
American King James Version×if not properly put in context. At this time, not all people are called to understand who God and Jesus Christ are, the power that They have and the work of salvation that They have done—and it is impossible to blaspheme the Holy Spirit without this understanding.
We can gain more perspective by examining the parallel accounts in Matthew and Mark. Both passages explain that Christ was responding to an accusation from His detractors, who said, “He has an unclean spirit” in Mark 3:30 Mark 3:30Because they said, He has an unclean spirit.
American King James Version×and, "This fellow does not cast out demons except by Beelzebub, the ruler of the demons" in Matthew 12:24 Matthew 12:24But when the Pharisees heard it, they said, This fellow does not cast out devils, but by Beelzebub the prince of the devils.
American King James Version×. These accusers were implying that Jesus' authority came from Satan rather than God. Jesus explained how illogical and knowingly false their accusation was: "If I cast out demons by Beelzebub, by whom do your sons cast them out? Therefore they shall be your judges. But if I cast out demons by the Spirit of God, surely the kingdom of God has come upon you" (Matthew 12:25-29 Matthew 12:25-29  And Jesus knew their thoughts, and said to them, Every kingdom divided against itself is brought to desolation; and every city or house divided against itself shall not stand:  And if Satan cast out Satan, he is divided against himself; how shall then his kingdom stand?  And if I by Beelzebub cast out devils, by whom do your children cast them out? therefore they shall be your judges.  But if I cast out devils by the Spirit of God, then the kingdom of God is come to you.  Or else how can one enter into a strong man's house, and spoil his goods, except he first bind the strong man? and then he will spoil his house.
American King James Version×).
Jesus was telling them that they knew better, or at least they should! The sin of blaspheming the Holy Spirit in the verses that follow was therefore not merely about insulting the power of God in ignorance, but because they knew Jesus was the Son of God and refused to admit it out of selfish pride. Like all sin, this was completely unacceptable to God; therefore, Jesus warned them that they would not be forgiven if they did not repent.
While Jesus' teaching about blaspheming the Holy Spirit may sound like an absolute condemnation of a one-time sin, He was actually warning against a persistent failure to submit to the power of God when one comes into the knowledge of God's existence and sovereignty. For a more detailed explanation of what it means for blaspheming the Holy Spirit to become the unpardonable sin, please see What is the unpardonable sin? What sin won't God forgive?