The movie opens with a play opening in London. While the producer, Charles Frohman (Dustin Hoffman), is assuring everyone of the play's worth, the author, James M. Barrie (Johnny Depp) is hiding behind a curtain, watching the audience through a mirror. His wife Mary is unable to find him, and is frustrated by it.
The play starts and through the mirror, Barrie can see people don't like it (within seconds of the start of the play). He gets an usher to tell him it's bad, even though the usher hasn't seen it. Barrie then imagines rain falling on the fidgety audience.
At the after party it's clear that the play was not well received and Barrie and the Producer know it's going to flop. Barrie's friend Arthur Conan Doyle (the guy who wrote Sherlock Holmes played by Ian Hart) hints at that as well and that Barrie isn't really enjoying some of those plays. The producer tells Barrie he's put a lot of money into the play and can't afford to lose it so Barrie had better come up with something else soon.
The next day Barrie takes his dog and goes to the park. He is sitting on the bench when he notices a young boy, Michael, under it. Michael is playing a game with his brothers George and Jack and soon the boys and their mother Sylvia (Kate Winslet) are over apologizing to Barrie. Instead of being mad, however, Barrie entertains the whole family by pretending his big dog is a bear and dancing with it. We can see in his imagination he sees himself as a ringmaster in a circus. The fourth boy, Peter, refuses to be taken into Barrie's pretend.
Barrie tells his wife about the family and she explains that the boys' father just died. His wife knows Sylvia's mother as a big socialite and wants Barrie to invite them to dinner so she can be acquainted with them.
Barrie continues to play pretend with the boys but Peter gets triggered into withdrawing from the pretending. Barrie tells Sylvia that Peter is trying to grow up because he thinks grown-ups don't get hurt when they lose someone. Barrie is also inspired by little things the boys do, for instance, them jumping on their beds makes him think of flying.
The family and Sylvia's strict mother (Julie Christie) come to dinner and for Barrie's wife and Sylvia's mother it's a disaster because Barrie and the boys keep playing around and talking about their pretend games with Sylvia playing along. Sylvia's mother doesn't want her to see Barrie anymore.
Barrie's play that opened in the beginning has to close and the producer tells him to come up with something fast because he still has the actors and theater on pay. Still Barrie uses the children for inspiration and he tells Peter he can be a writer too if he tries. Barrie asks Peter if he can name a character after him.
At a cricket match, Doyle tells Barrie that bad rumors are circulating about him for spending so much time with the family. Barrie finds this appalling.
Meanwhile, the producer thinks Barrie's play is crazy with fairies and pirates and so on, but continues on with the play. Barrie lets the family stay at his summer cottage and all of the boys and Sylvia play pretend with him. His wife doesn't like this and it is implied that she starts spending time with a friend of the family.
On one visit Peter has written a play that the boys put on but Sylvia starts coughing and they have to stop. The doctor comes and recommends more tests but Sylvia refuses to go to the hospital. Peter gets upset when Barrie won't tell him anything (Sylvia won't tell Barrie anything) and rips up his story saying people lied to him before when his father died.
When the family gets back to London Sylvia's mother announces she going to live with them and take care of them. She tells Barrie that his being around is preventing Sylvia from remarrying. Her no nonsense attitude inspired Captain Hook.
All of this, of course, is affecting Barrie's wife who Barrie hadn't been on good relations with before, but now it looks like she's about to leave him. She tells him that he wasn't there, even when he was physically there and asks that he comes home more.
Later, the play is being rehearsed when the boys show up. George explains that his mother was sick and they came over to be away. George also tells Barrie how worried he is for her and Barrie comments that George has grown up. As the boys are playing on the harnesses that make people fly Jack and Michael's squabble makes the man holding the ropes slip and George falls and breaks his wrist.
In the hospital, George refuses to have his wrist set unless Sylvia gets an examination. Sylvia tells Barrie that they won't tell her anything different and she'll do what they tell her to but she'll go on pretending things are better for her.
When Barrie gets back home that night he finds his wife gone.
Before the play the producer is afraid that the play will flop so Barrie asks him to hold 25 seats but won't tell him who for. The Producer is scared that this expense will be the final straw.
On the night of the play Sylvia and the boys are getting ready but Sylvia gets sick and has to stay in bed instead. Sylvia sends Peter instead so he can tell her about it. At the play the producer is concerned that the seats haven't been filled but then 25 children from an orphanage that Barrie has invited come in and are placed all throughout the theater.
The play opens and the adults are stiff at first, but the children enjoy it so much that the adults start to have fun too.
Barrie's wife is there even though she ran off with the friend and tells Barrie that it was the best he had written and the family helped him write it.
Barrie leaves the play earlier to visit Sylvia but comes back to the after party to pick up Peter. Everyone loves the play, especially the children.
Sylvia gets progressively worse after the play and is bedridden, so Barrie brings the play to her, having the actors perform it in her parlor. After Sylvia's mother leads the clapping to save Tinker Bell reality is gone from the play and Peter Pan and the fairies take Sylvia away to Neverland.
Later at Sylvia's funeral Peter starts to withdraw again but Barrie still wants to be there to help them. Sylvia's mother tells him that she doesn't have much choice because Sylvia requested in her will that Barrie and her mother be co-guardians of the boys and that she will respect her daughter's wishes. Barrie finds Peter on the bench and tells him that his mother will be with him if he can just find her in his imagination. He also tells Peter that he won't abandon the boys.