Globalisation may be breaking down international boundaries, but children are increasingly confining themselves to their immediate neighbourhoods. Many of them inhabit a world where stepping onto the wrong side of the road is insult enough to justify attack, where postcodes mark out borders that can't be crossed and where urban tribes spend their lives patrolling areas as small as 200 sq metres.

In Sunderland, youth centres now lay on minibuses for kids who dread walking through certain streets. In Bradford, getting to school has become a strategic exercise for children who have to avoid particular areas and get escorted through others. In Tower Hamlets, east London, which borders the Thames, one youth worker taking a group of local teenagers on a boat ride discovered that they had never seen the river.

These children live with a stifling awareness of territory. Until now, this psychological geography has been unchartered, but the Joseph Rowntree Foundation (JRF) today publishes a national investigation into its harmful effects. Over the past two years, researchers have talked to young people in Bradford, Peterborough, London, Glasgow, Sunderland and Bristol to find out where they feel safe, where they feel at risk and why.

The maps on the following pages - drawn by the children interviewed for the study - show just how strong, and sometimes dangerous, these territorial loyalties are. Take diagrams 1 and 2: two 11-year old boys were asked to draw maps of their neighbourhood in Glasgow. The boys sit next to each other in the same class at school but, because they live on opposite sides of the block, the areas they have marked "safe" and "don't go" in their illustrations are mirror opposites. They might be friends in the classroom, but they know that visiting each other's homes is - literally - "out of bounds".

We are familiar with divides based on race, class, gang membership or family; we are less familiar with divides based on geography alone. Take diagram 5: a young white girl from Yorkshire has neatly labelled the neighbourhood stereotypes, crosshatching the "Asian" areas brown and the "chavs" in pink (the small number of "poshos" are in yellow). While drawing, this 15-year-old explained that there is a long rivalry between the "all chavs no asians" estate in the top lefthand corner and the "all chavs" estate to the right of it. Similarly, the blue arrow indicates conflict between the two Asian groups nearer the centre. In these two areas, local boundaries trump race as the key source of conflict in the community.

In some cases, young people are confining themselves to areas that are less than a couple of blocks wide. In diagram 4, an 18-year-old man has drawn the boundaries of where he lives, noting the position of CCTV cameras. In total, the mapped space is less than 200 metres square. The areas crosshatched in blue, however, are out of bounds. The areas marked in orange - which include a smoking den behind a shop and the local pub - are the only places he feels safe. This is more than a natural apprehension about growing up and moving out; this is self-imposed isolation.

Chris Thompson, a young resident from Rowley Way estate in north London, says that he and his neighbouring mates feel safe in the one-and-a-half-mile stretch from Swiss Cottage to Kilburn, but certain areas not far beyond that are totally off limits.

"If you're on a different estate and they don't know you, you're going to get into trouble. It's just how it is," he says. "I've robbed people because they've been in my area. It's happened quite a few times. It starts with a question: 'Where are you from?' Then there's a fight and no one thinks of the consequences. It's like, if you don't live here, then you have no reason to be here - it's just roads and blocks. It's a pride thing. No one wants to back down."

I asked Thompson if he had ever been attacked for stepping into someone else's territory. "Nah, I wouldn't be caught slipping like that," he says. "Slipping is when you're out of your area, when you're on your own with no weapons - it's vulnerability. It's when you're on a bus with no one to protect you. I don't put myself in that position."

For Thompson and others like him, crossing certain borders raises a genuine threat of attack. But for a wider set of young people who aren't directly involved in territorial behaviour, the threat of violence is less obvious. For them, stepping beyond their three blocks doesn't necessarily feel dangerous - it just feels inappropriate. "Not leaving or going anywhere, that's just normal, that's just life. It's the right thing to do," says Thompson. "Most of the kids here have never been past Camden Town - not on their own. They've just sat on the same corner for five years. Once you've done that it's hard to get out."

Obviously, this trend has crippling implications. As well as increasing young people's risk of getting involved in violence, territorial thinking shuts down their opportunities. It means that young people aren't leaving their areas to go to better colleges, seek decent jobs or even get better healthcare. How can young people benefit from taking diplomas in the college of their choice if they're scared to walk to their local school? What's the point of opening up hospitals to competition if young people are terrified of the journey to their local GP?

Keith Kintrea, senior lecturer in urban studies at Glasgow University and co-author of the JRF report, believes that territoriality is limiting social mobility. "At a time when young people are supposed to be making the transition to adulthood and widening their horizons, they don't seem to be able to see life beyond their borders. This is reinforcing poverty in some of the UK's most deprived urban areas."

Kintrea believes this behaviour may also be driving up crime rates. "In some places, it seems to be acting as a mechanism through which young people get involved in organised crime like drug distribution."

The link between drugs and territories came up clearly in some of the young people's drawings. In diagram 3, an 18-year-old from Tower Hamlets has drawn a seemingly innocent community of halal butchers, restaurants and mosques. But all the figures depicted on the streets are drug dealers, and the cars - all Rolls-Royces - belong to local suppliers. The boundaries of his area are defined by the margins of the local drugs market.

Kintrea found that territoriality was most likely to affect young boys, most intensely between the ages of 14 and 17. Territory has always been a stereotypically male concern, and the gender divide was reflected in the research. A map drawn by a 15-year-old boy, depicting exactly the same neighbourhood as the girl's map in diagram 5, also highlighted two rival estates. But when he was asked why his map was so much emptier, he says it was because there was "nothing to do" in his neighbourhood. The researcher who interviewed him explained: "The shops and services that the girl had recognised simply did not exist on this boy's mental map. Because they were located in territory out of bounds, they weren't open to him. The girls we interviewed seemed less affected by these barriers."

JRF's research suggests that territoriality adversely affects young people who are not actively involved in conflicts. Not knowing that the territorial line exists, it seems, is no excuse for crossing it. As James Heath, 23, from north London, explains: "It doesn't matter if you're not looking for trouble. One of my mates got on the bus down the road and started getting intimidated by another guy: 'Are you from Zone [Harlesden, north London]? Then why haven't I seen you before?' He got beaten up just for being there."

Heath says that he is now "too old" to be involved in territorial conflict, but that the problem has escalated since he was a teenager. "There always was territory. Different estates and rival gangs would fight each other, but not to the same extent - and not over postcodes."

At present, there is no national research to show whether young people's sense of territory is growing. The anecdotal knowledge of youth workers and worried parents is all we have to go by. What is clear, however, is that territoriality is taking new forms. A new vocabulary has sprung up to describe local neighbourhoods: words such as "hood" and "area" are being replaced with talk of "endz" and "boundaries". These new terms have an inbuilt sense of limits. Your area is no longer just where you return to; it's where you stay.

Technology is reinforcing these subcultures. The internet was supposed to be about widening horizons, but in small bedrooms on estates, young people are using their computers to shut them down. Facebook groups are devoted to tiny physical localities; MSN groups help to coordinate territorial fights. The rise of grime music, spreading through digital stations such as Channel U, has also been blamed. Young people are seeking to emulate these new grime celebrities, posting hundreds of homemade tunes on YouTube to "rep their endz".

Music, technology, art and lyrics are all being used to celebrate some of the most deprived urban areas in the UK, areas where territoriality is at its strongest and most violent. This presents an intriguing paradox - why does a community's connection to place get stronger the worse that area becomes? According to JRF's report, territoriality often springs from "very positive motivations". Respect and recognition, personal protection and entertainment were all identified as key drivers of territorial behaviour. All human beings have a need for these things, but in some of the UK's poorest urban enclaves, they are hard to find. Territoriality helps to plug the gaps.

"In a place where there's nothing, you need to find a way of getting respect," says Heath. "These kids want it, but they don't want to work for it. It's not because they're lazy exactly - they've just never been taught. And controlling an area doesn't just feel like respect. It is respect. Whether you're a rich banker or whoever, you feel scared when you walk down a street that someone has marked as their territory - so it's real."

In a country that has very little need for people without skills and qualifications, Thompson believes territoriality may also be a way of salvaging self-esteem: "Pride is a big part of it - people are trying to show who they are and what they can do. But there's no money round here, it's hard to find a job and there's nothing to do. People think that if you can show you are the biggest man, you will get respect."

The challenge, then, is a difficult one. Young people need alternatives if they're to stop being territorial, but the behaviour itself will have to be broken down before they have the confidence to move beyond their self-imposed borders. Youth workers are already doing a lot - bussing young people to different areas and running conflict- resolution programmes - but little is being done to address the fundamental problem: the feeling in some communities that the opportunities of the wider world are not for them. If young people are to cross these invisible lines, they need help to connect with something better on the other side.

jrf.org.uk

• View more of the teenagers' maps SocietyGuardian.co.uk

· This article was amended on Monday October 20 2008. In the report above on neighbourhood territories as perceived by the young people who live in them, we said that an 18-year-old had drawn a diagram that included a zone of safety of less than 200 square metres. That should have been less than 200 metres square, or 40,000 square metres. This has been corrected.