I'm a nice person," Daniel Sloss - comedian, young person, sometime teller of jokes about bodily functions, XBox obsessive, possibly soon-to-be American TV star - is telling me as we sit in the slightly messy living room of his house in Edinburgh.

Which is nice, isn't it? Nice to be nice and all that. Thing is, however, he adds, it doesn't come naturally. It requires pure force of will.

"I'm a nice person," he continues, "only because I act like a nice person. It's not a natural instinct for me to be a good human being. But I constantly overwrite my natural instincts. My brain goes: 'What's the nice thing, the right thing to do in this situation?' Then I do that."

When we meet he is considering making his niceness or otherwise the subject of his Fringe show at Edinburgh. A show about, he says, "how much of a s**** human being I am. I have such horrible thoughts sometimes but then I catch myself thinking that and go, 'Dude, what the f***?'"

This is also the subject of our conversation today. That and comedy as an aphrodisiac, why women wear thongs, how marijuana opened his mind and the mental contortions he went through to buy his Geordie housemate and fellow comedian Kai Humphries a coffee when they stopped at a service station on tour. "Part of my brain went 'Kai will probably want a coffee' and my instinct went 'well, he can get his own coffee'." And so on. Humphries got his coffee but "he doesn't know the entire argument I had in my head with myself".

So, Daniel Sloss is a nice person, but … The "but" may be important.

He is 23, lives in the aforementioned house in Edinburgh with Humphries, his best friend Jean, a possibly life-sized plastic dinosaur (I'm a bit iffy on paleontology to be honest), a huge TV, the odd dirty sock on the floor and, as should now be clear, a sense of his own failings.

Yet Sloss is also brazenly self-confident, some might say arrogant (that's youth for you), relentless potty-mouthed and nursing an ambition to be the greatest comedian in the world in the eyes of his peers. "But I know that will take until I'm 40," he admits.

He made his Edinburgh debut at the age of 16. He's toured relentlessly - usually with Humphries as support - had his own BBC Three series and made a live DVD. So he is not lacking in experience. And after this August he will have seven Fringe shows in his locker.

Still, there's an itchy ambition in him that he's only beginning to scratch. "Last year was the best show I've done but I know in two years' time I'm going to look back at last year's show and if I don't think that last year's show is a piece of s*** that means I've failed as a comedian because that means I haven't improved."

You wonder, then, how he looks back on his 16-year-old self. "I hate him." Bit harsh, maybe. You wouldn't be sitting in your own house with a steady career without that 16-year-old, I point out. "I know, but I watch some of my old stuff and I always say if I could go back in time I wouldn't kill Hitler, I would kill me. Maybe not kill, because then I wouldn't exist. I would go back and beat the s*** out of myself.

"But I'm glad I feel that way because it means I'm better. If I looked back at stuff I was doing when I was 18 and thought, 'That's brilliant, I'm a genius,' that means between the ages of 18 and 23 I stayed the same and did not improve."

His mum and dad always tell him off when he starts cursing at the TV when his younger self pops up. That's what you were like at the time, they tell him. He understands that, but it's not enough. "I hate him. The haircut and the outlook. The style of comedy."

The reason for that hate, he says, is he's become very pretentious. He's watched American comedians Louis CK and Bo Burnham and wants to be as good as them. "Maybe before, my dream was to be a sell-out tour comedian and a household name, whereas now I want to be the comedian that comedians leave the green room for."

But to do that he has to learn. He has to educate himself about himself. He has to face up to his failings. It's a slow process. "I'm very pro-gay rights and I've always done material about that. But this year I was telling a joke I've been doing for three years and I suddenly realised that I was accidentally being sexist. Three years. My bit was: 'Imagine how great it would be being married to another man,' which, down the line, is s******* on women."

He gives me another example. At The Stand he was watching the comedian Raymond Mearns interact with the audience. "There were two women in the front row and Raymond was talking to them. 'What do you do?' 'I'm in the army.' 'What rank?' 'I'm a lieutenant general.' And the other one went, 'I'm a sergeant major.' And my reaction was so condescending. Sexism at that point would be, 'Oh boo, women don't belong in the army.' My reaction was worse. It was a worse kind of sexism because I went, 'Oh, good for you, well done.'

"Backstage I was going, 'Why was that my reaction?' It's nothing from my childhood. My mum is the strongest woman in the world. I grew up in a house with four men and she took none of our s***. My best friend is a female. I see the everyday bull**** sexism that she has to deal with that I never realised I was accidentally part of. She was talking the other day about how men stare at her and how bad it makes her feel and I went, 'Yeah. Oh, I do that. Oh, God.'

"I'm learning how to continuously be a better person. I'm not one, but I'm learning."

And, as a result, a better comedian too. Does he want to use comedy as an educational tool then? "Absolutely." His uncle is a minister. They agree on nearly everything about religion apart from the question of the existence of God. "He loves watching my shows. But he said after watching the show last year, 'You know you're a minister. You're a preacher.' It's not something I expected but I totally think it's a responsibility … not even to educate, but just to get people to question things. Last year was the first show I've ever done where I felt that I said something. There wasn't a message. I don't want to be that sort of comedian. I don't want to be the preachy, educational comic. I want to make them laugh but I want to make them think as a by-product."

He sweats over whether his material might be racist or sexist or homophobic. He runs it by his family, his friends, his fellow comedians. Could you be racist and still funny, I wonder? "To me, no, you can't. There will be loads of people that disagree." It's about honesty, he says. "The reason that comedy is funny is that it's honest and true and the thing about homophobia and racism and sexism is none of it's true. Women aren't inferior. Gays aren't disgusting. Black people aren't all crooks. If that's your joke it's not funny because it's not true."

Can honesty be sexy, though? Is comedy an aphrodisiac? "Yes and no. I haven't had a relationship in ages because I hate them but with my ex-girlfriend there was definitely a point if she'd seen me on stage where she would get turned on, even though I'm talking about masturbating and saying horrible stuff. But if you're on stage you're alpha dog. You're the centre of attention. It's a power thing."

But, he adds, nobody in the audience wants to sleep with him. "If a person sees a band on stage they'll go, 'Oh my God I want to f*** that person.' Nobody says that during comedy. Rock stars are creating an illusion of themselves whereas comedians are trying - or at least, I am trying - to go, 'Here I am in my rawest form,' and that's not as sexy."

Daniel Sloss was brought up in Fife and on stand-up comedians. His mother Lesley has a PhD in bacteriology. His father Martyn is, he says, "one of the smartest people men in the UK". They were - are - Sloss says, fiercely intelligent people. But they loved to laugh too. Sloss watched comedy with his dad from the age of five. Family gatherings were all banter and insult. You had to learn to be funny, he says. He got his first laugh at the age of seven. "Comedy is what made my family work."

He tells me about the time his mum found his marijuana when he was a teenager. He got a text when he was playing a gig in Ireland. "She texted me, 'I've got your wacky baccy,' to which my reply was, 'Nobody calls it wacky baccy.' She went, 'What do they call it?' 'Weed.' 'I found your weed, then.'"

When he came home he found it on his windowsill. Two days later she brought the subject up with him. His defence was that smoking made him a better person because it made him question himself. "She said, 'As long as you don't get addicted I guess I can handle it.' So growing up with that level of freedom was amazing."

So when you become a heroin addict … "She's going to be so p***** off."

He paints a picture of a close family. And like every family, the story has its painful passages. When Sloss was 10 years old his seven-year-old sister Josie died. She had cerebral palsy. After crying hard when he was first told of her death he spent the next week going around being chirpy and happy and trying to make people laugh. "I think her dying was the first sign that my reaction to things was to be the funny one.

"I do not think it was a domino but I think it was a moment where I realised I didn't like those awkward situations. I liked laughter. Laughter and jokes were my coping mechanism."

Along with his flatmates and fellow comedians, Sloss's parents are still his sounding board for material. It's his mum he asks to gauge the sexism of a routine. I tell him I'm twice the age he is (and more) and I'd still be mortified to talk to my mum about sex. But he says it's nothing new. When he first started on stage when he was 16 his parents had to drive him to gigs. "They saw my first gig. They saw my first 50 because I couldn't drive. When they've seen you talking about masturbating for 10 minutes there's not much else that can upset them." What was the conversation like on the drive home after that first gig though? "My mum's first words to me were: 'Well, you were very confident.' That was awkward."

It's later. Daniel Sloss and Kai Humphries are playing Xbox. A football game. Scotland v England. Guess who's who? Scotland win. It may be the only time Sloss has been on the telly of late. He's not one for panel shows. Doesn't think he's very good on them. But he has done the American chat show Conan O'Brien three times in six months. And maybe, just maybe that's led to something bigger waiting in the wings. He's signed a deal to create a pilot with O'Brien's Conaco production company for US TV. "I went in for a meeting with Warner Brothers. I was telling them about myself. Walked out and my agent said, 'That's amazing.' 'What?' 'You've just got a deal.'

"It's a pay-off and it proves I made the right decisions. When I got the Conan thing it felt like a massive gamble. It's proven that I've made the right decisions.

"And now," he jokes, "it's given me the arrogance to go and that's what I'm doing from now on. I'm always right. This one gamble I made paid off and so every other decision I make in my life will be perfect."

Daniel Sloss is trying to be a nice person. Is he the world's best comedian? Come back and check in 17 years. n

Daniel Sloss - Really ...?! is on at Venue 150@EICC until August 24 (except Aug 20). Kai Humphries: Stuff Protocol is at the Gilded Balloon until August 25 (except Aug 11).